1. Re: cgi's and procedures...[2]
- Posted by rubis at fem.unicamp.br Dec 11, 2002
- 384 views
Ok Robert, Good ideia ! I will try, but this only works for 2 procedures... thanks rubens At 16:23 10/12/2002, you wrote: > >Here is an example. > >procedure send_form() > puts(1,"Content-type: text/html\r\n\r\n") > puts(1,"<html>\n<body>\n") > puts(1,"<form name=\"form1\" method=\"post\" > action=\"/cgi-bin/cgi.ex\">\n") > puts(1,"<input type=\"submit\" name=\"submit\" value=\"click >here\">\n") > end procedure > > procedure read_data() > sequence data > data = gets(0) > puts(1,"Content-type: text/html\r\n\r\n") > puts(1,"<html>\n<body>\n") > puts(1,"The folowing data was recieved from a form:\n<br>\n") > puts(1,data) > end procedure > > object method > method = getenv("REQUEST_METHOD") > > if atom(method) then > puts(1,"Content-type: text/html\r\n\r\n") > else > if compare(method,"GET") = 0 then > send_form() > else > read_data() > end if > end if > > > ----- Original Message ----- > > From: robsz1 <robsz1 at netzero.net> > > To: <EUforum at topica.com> > > Sent: Tuesday, December 10, 2002 1:48 PM > > Subject: Re: cgi's and procedures... > > > > > > > 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... > > > > > > > > > > ============ The Euphoria Mailing List ============ > > > > > > > > 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 ? <snip>