CGI help

new topic     » topic index » view thread      » older message » newer message

I'm new to this and am trying to study IRV's stuff.

<eucode

  1. !/home/irv/euphoria/bin/exu

constant envars = {"SERVER_NAME","SERVER_PROTOCOL","SERVER_PORT","SERVER_SOFTWARE","SERVER_SIGNATURE", "GATEWAY_INTERFACE","REQUEST_METHOD","HTTP_ACCEPT","PATH","PATH_INFO","PATH_TRANSLATED", "DOCUMENT_ROOT","SCRIPT_NAME","SCRIPT_FILENAME","REQUEST_URI", "QUERY_STRING","REMOTE_HOST","REMOTE_ADDR","REMOTE_USER","UNIQUE_ID", "AUTH_TYPE","CONTENT_TYPE","CONTENT_LENGTH", "HTTP_USER_AGENT","HTTP_HOST","HTTP_CONNECTION", "REMOTE_PORT","SERVER_ADMIN"}

object now now = date()

build html page: puts(1,"Content-type: text/HTML\n\n") most important! puts(1,"<title>CGI-TEST.EX</title>\n") puts(1,"<body>\n") puts(1,"<IMG SRC=\"/gif/suse_150.gif\">\n") note the escaped quotes puts(1,"<H3>Euphoria CGI environmental variables found:</H3>\n") printf(1,"System time: %02d:%02d:%02d\n",{now[4],now[5],now[6]}) printf(1,"System date: %02d/%02d/%4d\n",{now[2],now[3],now[1]+1900})

retrieve values of environmental variables listed above: for i = 1 to length(envars) do if not atom (getenv(envars[i])) then show only initialized vars printf(1, "<LI>%s = %s </LI>", {envars[i], getenv(envars[i])} ) end if end for

end html page: puts(1,"</body></html>\n") </eucode.

When you launch a cgi program from a document (I know how to do that) does the executing program send it's output to the std output like the program above? If so, I can't see the returning document from his example above which I launch from his html document. I see a black screen flash if I run it directly and can see output if I put a gets(0) at the end. I never see anything back on IE....help!

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu