Re: CGI program only recognizes the "puts(1,"....\n") instr
- Posted by "Greg Haberek" <ghaberek at wowway.com> Aug 02, 2004
- 526 views
what's happening here, is exw is trying to report an warning saying that those variables have not been assigned a value. the problem is that your server (Apache?) won't allow the program to display any output to the screen, so it crashes. writing CGI in Euphoria is very difficult at first, since any error output to the screen causes the script to crash. try running your script on its own ("exw my_script_name.exw") first and see if you have any errors. if you can output only HTML and have no errors, then your script should run fine. to prevent unassigned variables from triggering warnings, use 'without warning' at the top of your script. another tip - if you're going to use include files in your scripts, you have to place them in the same directory as the main file, OR include them as the full path name here's the fix: #!c:\Euphoria\Bin\exw.exe without warning -- build html page: integer fn sequence line puts(1,"Content-type: text/HTML\n\n") -- most important! puts(1,"<html><head>\n") ----- Original Message ----- From: "John F Dutcher" <guest at RapidEuphoria.com> To: <EUforum at topica.com> Sent: Monday, August 02, 2004 3:42 PM Subject: CGI program only recognizes the "puts(1,"....\n") instr > ============ The Euphoria Mailing List ============ > > > posted by: John F Dutcher <John_Dutcher at urmc.rochester.edu> > > The following is the start of a CGI script... > It works fine 'until'...the very first 'non-'puts(1,"..\n")' > is introduced. The two commented lines at the beginning will > cause failure if uncommented..... no matter where they are placed. > > What's the secret to using the rest of the instruction set in a CGI ?? > > #!c:\Euphoria\Bin\exw.exe > > -- build html page: > -- integer fn > -- sequence line > puts(1,"Content-type: text/HTML\n\n") -- most important! > puts(1,"<html><head>\n") > puts(1,"<title>Blues Remits Splitter</title>\n") > puts(1,"<body text=blue>\n") > puts(1,"<center>\n") > puts(1,"<H1>Blues Remittances for 7/28/04</H1>\n") > puts(1,"<TABLE BORDER=1 BGCOLOR=pink>\n") > puts(1,"<tr><td colspan=30>Received Date</td>\n") > puts(1,"<td>Provider</td>\n") > puts(1,"<td>Svc Year</td>\n") > puts(1,"<td>Account #</td>\n") > puts(1,"<td>Last Name</td>\n") > puts(1,"<td>First Name</td>\n") > puts(1,"<td>Mid Init</td>\n") > puts(1,"<td>Sub Last Name</td>\n") > puts(1,"<td>Sub First Name</td>\n") > puts(1,"<td>Sub Mid Init</td>\n") > puts(1,"<td>Date of Birth</td>\n") > puts(1,"<td>HIC Number</td>\n") > > puts(1,"</tr></table>\n") > > --^---------------------------------------------------------------- > This email was sent to: ghaberek at wowway.com > > EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b7Ag8i.Z2hhYmVy > Or send an email to: EUforum-unsubscribe at topica.com > > For Topica's complete suite of email marketing solutions visit: > http://www.topica.com/?p=TEXFOOTER > --^---------------------------------------------------------------- >