1. cgi's and procedures...
- Posted by rubis at fem.unicamp.br Dec 10, 2002
- 403 views
Ok people, I will try to be as clear as possible: The situation: <form name="form1" method="post" action="/cgi-bin/cgi.ex"> --CGI script in euphoria (cgi.ex) in a windows webserver (Xitami) called by a submit form in html ---cgi.ex begins----------------------------------------------------------------------------------------------------- puts(1,form) - where form is another form, When I click submit, I wanto to call um() procedure um() puts(1,"1") end procedure ---- end of cgi.ex--------------------------------------------------------------------------------------- In words: How do I call a procedure using form if this form is generated by the cgi ? (and the procedure is inside the cgi program). If procedure um() was another euphoria program, no problem.... Thanks Rubens
2. Re: cgi's and procedures...
- Posted by Robert Szalay <robsz1 at netzero.net> Dec 10, 2002
- 395 views
Check the request method to decide which to send ? If the client goes to the link in there browsers(types it or clicks a link) the "REQUEST_METHOD" environment will be "GET". If it is "POSTED" from a form, then REQUEST_METHOD will be "POST" Hope that helps Regards, Robert Szalay ----- Original Message ----- From: <rubis at fem.unicamp.br> To: EUforum <EUforum at topica.com> Sent: Tuesday, December 10, 2002 2:32 PM Subject: cgi's and procedures... > > Ok people, I will try to be as clear as possible: > > The situation: > > <form name="form1" method="post" action="/cgi-bin/cgi.ex"> > --CGI script in euphoria (cgi.ex) in a windows webserver (Xitami) called > by a submit form in html > > ---cgi.ex > begins---------------------------------------------------------------------- ------------------------------- > > puts(1,form) - where form is another form, When I click submit, I wanto to > call um() > > procedure um() > puts(1,"1") > end procedure > > ---- end of > cgi.ex---------------------------------------------------------------------- ----------------- > > In words: How do I call a procedure using form if this form is generated by > the cgi ? > (and the procedure is inside the cgi program). > > If procedure um() was another euphoria program, no problem.... > > Thanks > > Rubens > > > > ---
3. Re: cgi's and procedures...
- Posted by rubis at fem.unicamp.br Dec 10, 2002
- 390 views
Hi Robert; This is not the problem. The request method is ok. I'm using post. The only problem is how to call a procedure inside a cgi.ex file by a form created by this cgi.ex. Rubens At 15:48 10/12/2002, you wrote: > >Check the request method to decide which to send ? > >If the client goes to the link in there browsers(types it or clicks a link) >the "REQUEST_METHOD" environment will be "GET". If it is "POSTED" from a >form, then REQUEST_METHOD will be "POST" > > >Hope that helps > >Regards, > Robert Szalay > > >----- Original Message ----- >From: <rubis at fem.unicamp.br> >To: EUforum <EUforum at topica.com> >Sent: Tuesday, December 10, 2002 2:32 PM >Subject: cgi's and procedures... > > > > Ok people, I will try to be as clear as possible: > > > > The situation: > > > > <form name="form1" method="post" action="/cgi-bin/cgi.ex"> > > --CGI script in euphoria (cgi.ex) in a windows webserver (Xitami) called > > by a submit form in html > > > > ---cgi.ex > > >begins---------------------------------------------------------------------- >------------------------------- > > > > puts(1,form) - where form is another form, When I click submit, I wanto to > > call um() > > > > procedure um() > > puts(1,"1") > > end procedure > > > > ---- end of > > >cgi.ex---------------------------------------------------------------------- >----------------- > > > > In words: How do I call a procedure using form if this form is generated >by > > the cgi ? > > (and the procedure is inside the cgi program). > > > > If procedure um() was another euphoria program, no problem.... > > > > Thanks > > > > Rubens > > > > >--- > > >
4. Re: cgi's and procedures...
- Posted by Sabal.Mike at notations.com Dec 10, 2002
- 400 views
You really only have two ways to do this. 1) Have a separate cgi program (cgi1.ex, cgi2.ex, etc.) for processing each form. 2) Have a hidden field indicating which form is being processed by cgi.ex and branch to the appropriate procedure based on that value. Just a side note from your example: procedures are defined before they are used, and no "call" statement is needed to invoke a procedure. The exception is when using routine_id, but I find that to be a non-optimal solution in a cgi program. HTH, Michael J. Sabal >>> rubis at fem.unicamp.br 12/10/02 03:18PM >>> Hi Robert; This is not the problem. The request method is ok. I'm using post. The only problem is how to call a procedure inside a cgi.ex file by a form created by this cgi.ex. Rubens
5. Re: cgi's and procedures...
- Posted by Robert Szalay <robsz1 at netzero.net> Dec 10, 2002
- 386 views
So then does my second post help ? You need to test the data received from the client. If there is a query string, then the client submited data. At wich point you will want to probably look at the data and decide what to do with it. I guess it wont hurt for me to release my url. http://www.euforge.com/~robsz1/ The chat section is a little broken. The bocazas client is not there anymore. I'll work on getting that back up there. Regards, Robert Szalay ----- Original Message ----- From: <rubis at fem.unicamp.br> To: EUforum <EUforum at topica.com> Sent: Tuesday, December 10, 2002 2:32 PM Subject: cgi's and procedures... > > Ok people, I will try to be as clear as possible: > > The situation: > > <form name="form1" method="post" action="/cgi-bin/cgi.ex"> > --CGI script in euphoria (cgi.ex) in a windows webserver (Xitami) called > by a submit form in html > > ---cgi.ex > begins---------------------------------------------------------------------- ------------------------------- > > puts(1,form) - where form is another form, When I click submit, I wanto to > call um() > > procedure um() > puts(1,"1") > end procedure > > ---- end of > cgi.ex---------------------------------------------------------------------- ----------------- > > In words: How do I call a procedure using form if this form is generated by > the cgi ? > (and the procedure is inside the cgi program). > > If procedure um() was another euphoria program, no problem.... > > Thanks > > Rubens > > > >
6. Re: cgi's and procedures...
- Posted by rubis at fem.unicamp.br Dec 11, 2002
- 414 views
Hi Michael; >You really only have two ways to do this. > >1) Have a separate cgi program (cgi1.ex, cgi2.ex, etc.) for processing >each form. ok, this is what I was trying to avoid... >2) Have a hidden field indicating which form is being processed by >cgi.ex and branch to the appropriate procedure based on that value. hummm... could be a good option. I have to try. There is no limit of procedures. >Just a side note from your example: procedures are defined before they >are used, and no "call" statement is needed to invoke a procedure. The >exception is when using routine_id, but I find that to be a non-optimal >solution in a cgi program. yes , you are right. thanks Rubens >HTH, >Michael J. Sabal > > >>> rubis at fem.unicamp.br 12/10/02 03:18PM >>> > >Hi Robert; > >This is not the problem. The request method is ok. I'm using post. >The only problem is how to call a procedure inside a cgi.ex file by a >form >created by this cgi.ex. > >Rubens > > >
7. Re: cgi's and procedures...
- Posted by Kat <kat at kogeijin.com> Dec 11, 2002
- 391 views
On 10 Dec 2002, at 22:22, Robert Szalay wrote: > > So then does my second post help ? > > You need to test the data received from the client. > If there is a query string, then the client submited data. > At wich point you will want to probably look at the data and decide what to do > with it. > > I guess it wont hurt for me to release my url. > > http://www.euforge.com/~robsz1/ from: http://www.euforge.com/~robsz1/ Ooops! Sorry, this page uses frames and your browser does not support them. But it does support frames. Kat
8. Re: cgi's and procedures...
- Posted by jordah at btopenworld.com Dec 11, 2002
- 408 views
Can we also host our sites there? ie euforge... ----- Original Message ----- From: "Robert Szalay" <robsz1 at netzero.net> To: "EUforum" <EUforum at topica.com> Subject: Re: cgi's and procedures... > > So then does my second post help ? > > You need to test the data received from the client. > If there is a query string, then the client submited data. > At wich point you will want to probably look at the data and decide what to > do with it. > > I guess it wont hurt for me to release my url. > > http://www.euforge.com/~robsz1/ > > The chat section is a little broken. The bocazas client is not there > anymore. I'll work on getting that back up there. > > > Regards, > Robert Szalay > > > ----- Original Message ----- > From: <rubis at fem.unicamp.br> > To: EUforum <EUforum at topica.com> > Sent: Tuesday, December 10, 2002 2:32 PM > Subject: cgi's and procedures... > > > > Ok people, I will try to be as clear as possible: > > > > The situation: > > > > <form name="form1" method="post" action="/cgi-bin/cgi.ex"> > > --CGI script in euphoria (cgi.ex) in a windows webserver (Xitami) called > > by a submit form in html > > > > ---cgi.ex > > > begins---------------------------------------------------------------------- > ------------------------------- > > > > puts(1,form) - where form is another form, When I click submit, I wanto to > > call um() > > > > procedure um() > > puts(1,"1") > > end procedure > > > > ---- end of > > > cgi.ex---------------------------------------------------------------------- > ----------------- > > > > In words: How do I call a procedure using form if this form is generated > by > > the cgi ? > > (and the procedure is inside the cgi program). > > > > If procedure um() was another euphoria program, no problem.... > > > > Thanks > > > > Rubens > > > > > > >