Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Sep : Re: Indy 8: HTTP server - Can it be used with PHP?
| Subject: | Re: Indy 8: HTTP server - Can it be used with PHP? |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Tue, 26 Sep 2006 10:19:18 |
"Jamie Dale" <j.dale@turboz.net> wrote in message
news:4519043e@newsgroups.borland.com...
> Yes I realise that, but what I was asking is, is there a way to
> make the IdHTTP server recognise what it should pass to PHP?
Like I said, I cannot speak for Indy 8, but in Indy 9/10, yes. The posted
values are provided to your server code. Or, what you generally would do
instead is recognize that the request is trying to execute a PHP script, so
you would then forward the raw posted data as-is to the PHP executable
instead. When you run the PHP executable, you would have to redirect its
STDIN, STDOUT, and STDERR pipes. CreateProcess() and CreatePipe() can help
you with that, and there are lenty on examples online to demonstrate that.
You would then write the posted data to the PHP's STDIN pipe, and then pass
back to the client any data that you read from the STDOUT and STDERR pipes.
Gambit