Re: I/O Rediredtion under DOS and I think UNIX
- Posted by "Carl R. White" <C.R.White at SCM.BRAD.AC.UK> Mar 24, 1998
- 834 views
On Sun, 22 Mar 1998, Daniel Berstein wrote: > The other day I tried to make a small CGI with Euphoria (using OmniHTTP > server for Windows 95). It failed. Why? Because I couldn't make the CGI > return it's output to the browser (or server). Someone told me the trick was > sending the output stream to STDOUT... but didn't work. Does anyone knows > how a CGI sends output? You've got the essence there, you *do* need to send to STDout... Maybe your cgi just needs a little tweaking. ---- Here's a sample cgi (not in Euphoria though...): #!/bin/ksh -p # FingerMe.cgi from my webpage echo Content-type: text/plain echo "" finger crwhite at dcsun1.comp.brad.ac.uk ---- And another one: #!/bin/ksh # Beta directory reader echo Content-type: text/html echo echo "<HTML>" echo "<HEAD><TITLE>File lister test</TITLE></HEAD>" echo "<BODY>" echo "<H1>Directory of $1</H1>" echo "<PRE>" ### snip echo(es of) html stuff echo "</PRE><HR>" echo "<BR>" The point I'm trying to make here is the "Content-type:" and the blank lines have to be there. Without them the cgi doesn't work. HTH, Carl -- Carl R White - "Big brotherism: Doublethink so exist I (Descartes/CRW)" E-mail...: cyrek- at -bigfoot.com / Remove the hyphens before Finger...: crwhite- at -dcsun1.comp.brad.ac.uk \ mailing or fingering... Url......: http://www.bigfoot.com/~cyrek/