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

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


In message <OF95E550A4.6360C772-ONC1256CA3.0066A636@root@martin-papadopoulos.de>
on 01/04/03(03:44:37) you payeabdyi-mnvdjlzx4rfr.ml@ml.delegate.org 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
content.
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]
#!/bin/sh
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]
#!/opt/php/php
... a PHP script to generate "Content-Type:text/html"
... a PHP script to generate an empty-line
... a PHP script to generate HTML content


Cheers,
Yutaka
--
  @ @ Yutaka Sato <y.sato@delegate.org> http://www.delegate.org/y.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]
@_@V