PDA

View Full Version : setting variable on .pl doc


Beck1
09-02-2004, 10:05 AM
I am having a problem setting these two variables on a guest book script:
$guestbookreal = "/home/yourname/public_html/guestbook.html";
$guestlog = "/home/yourname/public_html/guestlog.html";

The script all works fine when I try it on a domain that is hosted on it's own, but the domain I want to add the script to is parked on the same webspace as another domain, and none of the variations I have tried seem to work - an internal 500 error keeps appearing when I try to submit the form on the addguest page.

The public_html folder sits under the domain folder (which is named as the URL).

I've tried:

$guestbookreal = "/home/yourname/wwwfoldername/public_html/guestbook.html";
$guestlog = "/home/yourname/wwwfoldername/public_html/guestlog.html";

$guestbookreal = "/home/wwwfoldername/yourname/public_html/guestbook.html";
$guestlog = "/home/wwwfoldername/yourname/public_html/guestlog.html";

$guestbookreal = "/wwwfoldername/home/yourname/public_html/guestbook.html";
$guestlog = "/wwwfoldername/home/yourname/public_html/guestlog.html";

and
$guestbookreal = "/wwwfoldername/yourname/public_html/guestbook.html";
$guestlog = "/wwwfoldername/yourname/public_html/guestlog.html";

Can anyone help? I'd be really grateful.

Thanks,
Beck

mlseim
09-04-2004, 06:37 AM
Just for the heck of it, try a relative reference ...

Meaning, if your cgi-bin (where the script is stored) is one directory
ahead of your HTML directory, try a relative reference:

$guestbookreal = "../public_html/guestbook.html";

where; "../" means to "back up" one directory from where you currently are.

or:

$guestbookreal = "../../public_html/guestbook.html";
(go back two directories)

Without seeing the whole script, it's hard to tell if they need an
'absolute' reference or a 'relative' reference.

Beck1
09-04-2004, 12:12 PM
Thanks for your reply, I ended up using a test.cgi script available on www.ezscripting.co.uk which tells you the path etc of the directory you run it in - there were some numbers in there that I never would have known about! It now works OK.