Help... Im lost(again) (was Re: More about Euphoria CGIs (a
- Posted by Grape Vine <chat_town at HOTMAIL.COM> Mar 16, 1999
- 454 views
Hiya all, I must be as think as a brick... I have been messing with this since this first was posted and had this lower example work... Then i started messing with code and messed up.. So i restored the code to what it had been... Then it starts to give theerr hex number not formed correctly .. and now i cant get it to work... and i realy need it to... Im tryign to put it on a web site for my clan(age of empires: rise to rome) to report the statis of our games.... TIA Grape Vine >From: Daniel Berstein <daber at PAIR.COM> >Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> >To: EUPHORIA at LISTSERV.MUOHIO.EDU >Subject: More about Euphoria CGIs (a succesful story!) >Date: Wed, 3 Mar 1999 01:19:01 -0400 > >I tried to execute the EuCGI without binding it. I was unsuccesful :( > >Here's the problem: > >Xitami recognize as a CGI a file that is located in a valid cgi directory >(it must be configured on the server for security reasons) *and* must >follow one of these criterias: > >a) Be a valid exe file (starts with MZ). >b) Start with #! a space and followed by the full path of the interpreter >(used by Perl and Awk scripts). >c) Start with /*! a space and followed by the full path of the >interpreter, and the last text in the line is */ (used by Rexx scripts). > >I made a silly test and put on the first line of my code: #! >c:\euphoria\bin\exw.exe > >Half Eureka. The server recognized it as a CGI and spawned exw.exe... with >the obvious error raised by Euphoria: > >C:\Xitami\cgi-bin\cgitest.exw:1 >hex number not formed correctly >#! c:\euphoria\bin\exw.exe > >So here is a new entry to 2.1 beta wish-list: > >Rob, please be so kind to just raise a Warning if the very first line of >the code is either a Perl/Awk or Rexx style comment (I asume several other >servers work a similar). > >Creating bounded EuCGI is functional, but storage of all those .exe files >may not be desireable. Unregistered (yet) users may start playing with >Euphoria for creating their own CGI's... you know, anything WWWebable is a >commercial success ;) (at least for book publishers). > > >*Attention* >While writing this email an idea jumped of my mind: > >If Xitami reads the first line of a Perl/Awk script to get the interpreter >path, then maybe I oculd fool it. So I created a blank new text document >(with Notepad) and wrote: > >#! c:\euphoria\bin\exw.exe c:\xitami\cgi-bin\cgitest.exw > >Followed by a blank line. > >It worked! Xitami just called exw.exe with the first parameter as my EuCGI >and as second (passed to my script's command line) the location of the >"wrapper" text cgi. From now on I'll use this method for my EuCGI's. In >fact I just moved eucgi.exw from the cgi-bin directory to >c:\eucgi\eucgi.exw and instead put a wrapper file called eucgi (no >extension) that says: > >#! c:\euphoria\bin\exw.exe c:\eucgi\eucgi > >The only withdraw of this method is that the current working directory is >set where the wrapper is. if you need to get the path of the actual >Euphoria code you could SET a variable on autoxec.bat (EUCGI_DIR?). Rob, >why can't command_line give the path of unbounded files? > >Maybe my wish-list contribution should be ommited, but not the idea of >making Euphoria more WWWebable. > >I apologize for this long and evolving post, it's one of those emails you >write while coding and testing. Anyways I thought it may be useful to >follow the nature of this "hack". > > >Regards, > Daniel Berstein > [daber at pair.com] > Get Your Private, Free Email at http://www.hotmail.com