1. EUPHORIA Server Pages (Was Re: DHTML and CGIs in Euphoria)
- Posted by "C. K. Lester" <euphoric at cklester.com> Oct 06, 2003
- 373 views
rml at rubis.trix.net wrote: > > Thanks Lucius. In my next cgi I will try this. > Your ideas are very intersting. This method is much > more easy to work with DHTML than printf and %s. > > Is there more people in the list working with cgi scripts in euphoria ? I'm trying to get this site spec'ed... http://www.cklester.com/mpg/ It's being totally done by EUPHORIA Server Pages (ESP). And it's pretty much easy-going so far. I'm going to set up my second PC with FreeBSD and set up a testbed, because the way I do it now is modify the ESP in UltraEdit, upload with WS_FTP, view the site, deal with any errors, etc... It's kinda laborious. Anybody have any better solutions for working with EUPHORIA CGI stuff? I figure once I get my testbed goin', it will be a lot easier.
2. Re: EUPHORIA Server Pages (Was Re: DHTML and CGIs in Euphoria)
- Posted by Lucius Hilley <l3euphoria at bellsouth.net> Oct 06, 2003
- 401 views
Someone have a better idea? Yes I do! First off. You will likely want to be able to easily turn the better way off once in production. such as. constant TESTING = 0 if TESTING then do things this way. end if If (command line parameter passed) then assume parameter is name of file containing test data and load test data from the file. -- exu prog.esp testdata.txt else -- (load using usual cgi methods) Use the standard cgi data loading methods environment, & keyboard. end if If (you are creating all the little programs) then You can completely control how they work. Put into everyone of your little ESP programs a secondary method of getting data. end if Standard CGI method is through environment variables, and keyboard input. None of these use the command line. <psedo-code> -- cgi-pack.e -- --functions to handle things sequence cmd_line cmd_line = command_line() if (3 > length(cmd_line)) then -- Nothing on the command_line env_var = get_cgi_env() -- This would call things like get_env("CONTENT_LENGTH") -- and could look something like. -- {"CONTENT_LENGTH", "138", "METHOD", "POST", "BROWSER", "Mozilla"} -- or maybe like -- {{"CONTENT_LENGTH", "METHOD", "BROWSER"}, -- {"138", "POST", "Mozilla"}} form_var = "" if (equal(env_var[METHOD], "POST")) then form_var = get_post() -- Getting post method end if --PS: You should always get using the get method even when post method is used. form_var &= get_get() -- Getting get method else -- Load the command line file for variables instead. in = open(cmd_line[3], "r") line = gets(in) while sequence(line) do -- while not end of file (EOF) line = trim_lf(line) -- if linefeed exists then trim it. if (equal(upper(line), "[VALUES]")) then -- Boundary tag between environment and form exit -- end if env_var &= data_pair(line) -- deals with: line ="BROWSER=Mozilla 1.14" line = gets(in) end while line = gets(in) while sequence(line) do -- while not end of file (EOF) line = trim_lf(line) -- if linefeed exists then trim it. form_var &= data_pair(line) -- deals with: line ="USER=Unkmar" line = gets(in) end while end if -- last of cgi-pack.e -- include cgi-pack.e -- cgi package that you include with every respond_to_cgi_request() </psedo-code> Lucius L. Hilley III ----- Original Message ----- From: "C. K. Lester" <euphoric at cklester.com> To: "EUforum" <EUforum at topica.com> Sent: Sunday, October 05, 2003 10:16 PM Subject: EUPHORIA Server Pages (Was Re: DHTML and CGIs in Euphoria) > > > rml at rubis.trix.net wrote: > > > > > Thanks Lucius. In my next cgi I will try this. > > Your ideas are very intersting. This method is much > > more easy to work with DHTML than printf and %s. > > > > Is there more people in the list working with cgi scripts in euphoria ? > > I'm trying to get this site spec'ed... > > http://www.cklester.com/mpg/ > > It's being totally done by EUPHORIA Server Pages (ESP). And it's pretty > much easy-going so far. I'm going to set up my second PC with FreeBSD > and set up a testbed, because the way I do it now is modify the ESP in > UltraEdit, upload with WS_FTP, view the site, deal with any errors, > etc... It's kinda laborious. > > Anybody have any better solutions for working with EUPHORIA CGI stuff? I > figure once I get my testbed goin', it will be a lot easier. > > --^---------------------------------------------------------------- > This email was sent to: l3euphoria at bellsouth.net > > > TOPICA - Start your own email discussion group. FREE! > >