Rev CGI scripts

Andre Garzia andre at andregarzia.com
Mon Aug 11 22:22:03 EDT 2008


Sarah,

instead of linking with URLs like

<a href="http://192.168.0.123:8888/folder/file.txt">

why don't you use root relative paths without the server, like:

<a href="/folder/file.txt">

if so, the server part will be assumed to be the same one serving the page.

Cheers
andre



On Mon, Aug 11, 2008 at 11:11 PM, Sarah Reichelt
<sarah.reichelt at gmail.com> wrote:
> 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
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list