Rev CGI scripts

Sarah Reichelt sarah.reichelt at gmail.com
Mon Aug 11 22:11:49 EDT 2008


Hi All,

I'm writing a Rev-based CGI stack and one of it's functions is to
return a web page containing a set of links that the CGI stack has
generated.
This web page is not saved anywhere, it just gets sent back to the
calling browser, so the links in it need to be absolute links, not
relative links.
For this to work, the CGI stack needs to be able to know it's own address.

e.g. if I am running it on my own computer for testing, the address
will be http://localhost:8888/.....
and if on another computer on the network, it might be
http://192.168.0.123:8888/....
and the first part of these addresses needs to be the first part of
any links in the returned web data.

Based on a post by Ken Ray
<http://www.nabble.com/Re%3A-CGI---OS-X-problem-p6848927.html>
I have been trying to use the system globals, but while I can get
$SERVER_PORT, I don't have a global that gives me the address.
$SERVER_NAME and $SERVER_ADDR do not exist, whether I call the CGI
from within Rev or from a browser.

Does anyone have any ideas, as I really don't want to hard-wire this in.

TIA,
Sarah



More information about the use-livecode mailing list