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: | "Jamie Dale" (j.da..@turboz.net) |
| Date: | Tue, 26 Sep 2006 18:42:24 |
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:451962b7$1@newsgroups.borland.com...
>
> "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.
Yep, found that in Indy 8 - Accessed as: RequestInfo.Params
EG
For I := 0 to RequestInfo.Params.Count -1 do
begin
lbLog.Items.Add(RequestInfo.Params.Strings[I]); //lbLog is a
TListBox
end;
I don't know how you access them in 9/10 but thats how I found it could be
done in V8 (acessing each parameter one by one).
> 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.
Ah! - That sounds like the info I needed! - Thanks Remy I'll google these
ideas now and see what I can do!
Thanks pal!
J