Thread View: borland.public.cppbuilder.internet.web
6 messages
6 total messages
Started by Jens Harms
Wed, 13 Apr 2005 16:49
idhttpserver question
Author: Jens Harms
Date: Wed, 13 Apr 2005 16:49
Date: Wed, 13 Apr 2005 16:49
18 lines
1629 bytes
1629 bytes
hi, i like to write an application which is running on a my windows server 2003. this application should habe a http server in it. thus i like to use idhttpserver. i have a form on my homepage. in this form the user can insert his email und a special number. when the user press the send button i like to send these to information to my server application. i thought of of http post like http://something.homedns.org:83/?var1=email@email.com&var2=1234 my server application, should read these values und wirte them into a listbox. is this possible with id httpserver. it the way with http post a good way or is there a better way. i have no idea how to do. jens
Re: idhttpserver question
Author: Hans Galema
Date: Wed, 13 Apr 2005 18:32
Date: Wed, 13 Apr 2005 18:32
28 lines
2034 bytes
2034 bytes
> i like to write an application which is running on a my windows server 2003. > this application should habe a http server in it. thus i like to use > idhttpserver. IdHttpServer ? Could you take the time to use capitals please ? > i have a form on my homepage. in this form the user can insert his email und > a special number. when the user press the send button i like to send these > to information to my server application. i thought of of http post like > http://something.homedns.org:83/?var1=email@email.com&var2=1234 That looks like a get. Not a post. The method attribute of the form tag determines if the browser sends the request as a post or a get. > my server application, should read these values und wirte them into a > listbox. Indeed. > is this possible with id httpserver. it the way with http post a good way or > is there a better way. i have no idea how to do. Of course TIdHttpServer will receive all data as get or post. Please be more exact in explaining what your real problem is. Hans.
Re: idhttpserver question
Author: Jens Harms
Date: Wed, 13 Apr 2005 19:16
Date: Wed, 13 Apr 2005 19:16
61 lines
2810 bytes
2810 bytes
Hi, i have build me a http web form whoch open this php file: <? $url = "http://192.168.0.10:8080/mail=" . $mail . "&id=" . $id; echo file_get_contents($url); ?> an example string would be http://192.168.0.10:8080/mail=info@hotmail.com&id=12345 In my application i am working with the CommandGet event (from idhttpserver) and read the parameters via: String line = ARequestInfo->Document; Line has now the value "/mail=info@hotmail.com&id=12345" now i ask me how to get the values for id and mail. is there perhabs a better way to transfer the information to make it easyer or do i have to write a string parsr which gives me the id and the email? jens "Hans Galema" <notused@notused.nl> schrieb im Newsbeitrag news:425d664c$1@newsgroups.borland.com... > > > i like to write an application which is running on a my windows server 2003. > > this application should habe a http server in it. thus i like to use > > idhttpserver. > > IdHttpServer ? Could you take the time to use capitals please ? > > > i have a form on my homepage. in this form the user can insert his email und > > a special number. when the user press the send button i like to send these > > to information to my server application. i thought of of http post like > > http://something.homedns.org:83/?var1=email@email.com&var2=1234 > > That looks like a get. Not a post. The method attribute of the form > tag determines if the browser sends the request as a post or a get. > > > my server application, should read these values und wirte them into a > > listbox. > > Indeed. > > > is this possible with id httpserver. it the way with http post a good way or > > is there a better way. i have no idea how to do. > > Of course TIdHttpServer will receive all data as get or post. > > Please be more exact in explaining what your real problem is. > > Hans.
Re: idhttpserver question
Author: Remy Lebeau (TeamB)
Date: Wed, 13 Apr 2005 19:51
Date: Wed, 13 Apr 2005 19:51
20 lines
1554 bytes
1554 bytes
"Jens Harms" <jens@harms.ch> wrote in message
news:425d700c@newsgroups.borland.com...
> an example string would be
>
> http://192.168.0.10:8080/mail=info@hotmail.com&id=12345
That is not a valid URL. Data parameters must be placed after a "?"
character, which in turn should follow a filename, and special characters
like @ should be encoded, ie:
http://192.168.0.10:8080/somedocument?mail=info%40hotmail.com&id=12345
On the server end, the ARequestInfo->Document property will now be
"/somedocument" and the ARequestInfo->Params property will be filled in with
the "mail" and "id" values.
Gambit
Re: idhttpserver question
Author: Jens Harms
Date: Wed, 13 Apr 2005 20:39
Date: Wed, 13 Apr 2005 20:39
53 lines
2589 bytes
2589 bytes
hi gambit, > http://192.168.0.10:8080/somedocument?mail=info%40hotmail.com&id=12345 i changed my php script and use urlencode function, to decode the parameter ;) > On the server end, the ARequestInfo->Document property will now be > "/somedocument" and the ARequestInfo->Params property will be filled in with > the "mail" and "id" values. to check this i wrote: ShowMessage(ARequestInfo->Params->Text); i get this here: --------------------------- | mail=info@hotmail.com | | id=12345 | --------------------------- is there also an easy way to read the values 12345 and info@hotmail.com into to string variables named String mail and String id? jens "Remy Lebeau (TeamB)" <no.spam@no.spam.com> schrieb im Newsbeitrag news:425d77c6$1@newsgroups.borland.com... > > "Jens Harms" <jens@harms.ch> wrote in message > news:425d700c@newsgroups.borland.com... > > > an example string would be > > > > http://192.168.0.10:8080/mail=info@hotmail.com&id=12345 > > That is not a valid URL. Data parameters must be placed after a "?" > character, which in turn should follow a filename, and special characters > like @ should be encoded, ie: > > http://192.168.0.10:8080/somedocument?mail=info%40hotmail.com&id=12345 > > On the server end, the ARequestInfo->Document property will now be > "/somedocument" and the ARequestInfo->Params property will be filled in with > the "mail" and "id" values. > > > Gambit > >
Re: idhttpserver question
Author: Remy Lebeau (TeamB)
Date: Wed, 13 Apr 2005 20:52
Date: Wed, 13 Apr 2005 20:52
15 lines
1596 bytes
1596 bytes
"Jens Harms" <jens@harms.ch> wrote in message
news:425d8361@newsgroups.borland.com...
> is there also an easy way to read the values 12345 and
> info@hotmail.com into to string variables named String mail and String id?
The Params property is a TStrings, and as such it inherits Name[] and
Values[] subproperties.
AnsiString mail = ARequestInfo->Params->Values["mail"];
AnsiString id = ARequestInfo->Params->Values["id"];
Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads