Article delegate-en/2059 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: SSL Tunneling an php external script
04 Jan 2003 05:20:49 GMT (Yutaka Sato)

In message <>
on 01/04/03(03:44:37) you wrote:
 |back to (1)  the point is that a file in e.g. called script.php has to be 
 |excuted externally by the script engine e.g: /opt/php/php
 |the script engine then returns a whole html file back to server and the 
 |server to the client.
 |so what i want to do is to have the file parsed to the engine ( 
 |script-engine ) and the result to the client.
 |is there a way to do it.
 |I don't exactly know if this can be done via CFI ??

You can use standard "CGI" (Common Gateway Interface) to dynamically
generate data of any type including HTML or GIF, which can depend on
the requesting HTTP message.  The interface of CGI is as simple as
possible I can imagine and is applicable to wide applications; just
output the type of content in Content-Type header before putting the
I don't know the syntax of PHP, but it must be so easy to do it in PHP.
Or you can generate necessary header with a wrapper script.  If your
script file is named XXX.php, you can wrap it with a script file named
XXX.cgi for example and with content as follows:

[the content of XXX.cgi]
echo "Content-Type: text/html"
echo ""
/opt/php/php XXX.php

Of course you must set the executable flag of the file XXX.cgi so
that you can invoke it with "XXX.cgi" from your command line without
"/bin/sh XXX.cgi".  And of course you can write XXX.cgi in PHP which
might be like this:

[the content of XXX.cgi]
... a PHP script to generate "Content-Type:text/html"
... a PHP script to generate an empty-line
... a PHP script to generate HTML content

  @ @ Yutaka Sato <>
 ( - ) National Institute of Advanced Industrial Science and Technology (AIST)
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]