Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Absolute magic names?

I have a form that passes its CGI script a url, which is where the CGI will take you after it's processed the form. I need this to be in a different directory from the one with the form in, and I want to use a magic name for it. The CGI is in a third directory, and I can't move it.

The problem is, the magic name is generated relative to the directory the form is in. So when the CGI uses it, it doesn't work. What I need is for the magic name to generate an absolute path from the Citydesk root.

Is there any way to do this? I can think of a few nasty hacks, but nothing maintainable when I come back in 6 months having forgotten why I did them.

The form field is <INPUT type=hidden value=PTMFOG0000000034 name=redirect>, and the URL it generates is "../form-ack.html".

Michael Wild
Friday, October 25, 2002

absolute magic names have already been requested often (by me).

The only work around for magic names is if you can recreate the structure of the server (if this is acceptable for you; you won't be able to just publish to a different server!)

so if you have

/www/username/html    for your pages
and
/www/username/cgi-bin  for your cgi-bin
then put all articles under a html folder and cgi's in the cgi-bin. Then the relative references should work within the filesystem and hopefully within the virtual server.

Adriaan van den Brand
Friday, October 25, 2002

I forgot to mention. With the solution I mentioned, you'll need to change the publish path to a path common to cgi-bin and html.

Adriaan van den Brand
Friday, October 25, 2002

Something like

{$ foreach x in (magicname "xxxxx") $}
...do something with x.abslink...
{$ next $}

would be nice, if it worked....

Pat Rice
Friday, October 25, 2002

*  Recent Topics

*  Fog Creek Home