PDA

View Full Version : Warning with PHP scripted form



cstyles
01-23-2006, 10:58 AM
Can anyone help me.
I've published a form on my website, in php scripting, where the form directs to either a confirmaiton page or a failure page, through a processform page (if that makes sense).
I have altered the CHMOD to 755, as the host suggests and the form now sends me the information via email.
However, it doesn't re-direct to the confirmation page, and instead come up with the error:

Warning: main(cgi-bin/confirmation.php): failed to open stream: No such file or directory in /files/home2/allcockgrieves/cgi-bin/processform.php on line 76

Warning: main(): Failed opening 'cgi-bin/confirmation.php' for inclusion (include_path='.') in /files/home2/allcockgrieves/cgi-bin/processform.php on line 76

Any ideas? I'd be very greatful.

Twey
01-23-2006, 12:39 PM
"No such file or directory" kind of gives this away. I daresay ~/cgi-bin/cgi-bin/confirmation.php doesn't exist. Try just including "confirmation.php".

cstyles
01-23-2006, 02:16 PM
...and then putting the files in the root directory, rather than the 'cgi-bin' folder?

Twey
01-23-2006, 02:55 PM
No.
Warning: main(cgi-bin/confirmation.php): failed to open stream: No such file or directory in /files/home2/allcockgrieves/cgi-bin/processform.php on line 76processform.php is in cgi-bin. Inside processform.php, you have done something like
include("cgi-bin/confirmation.php");. This means that, when translated to an absolute path, you are attempting to include /files/home2/allcockgrieves/cgi-bin/cgi-bin/confirmation.php, rather than /files/home2/allcockgrieves/cgi-bin/confirmation.php as you probably should be. Moving the file so that it is /confirmation.php isn't going to help matters.

cstyles
01-23-2006, 03:08 PM
Thank you, I've solved the issue - finally! It's taken some time.
You were right, I was directing it to the folder 'cgi-bin' when it was already looking in that folder, and therefore confusing it.
It's all sorted and works perfectly! The feedback form emails me the details and then re-directs the viewer to the confirmation page.
Marvellous!
Just got work out why some boxes are yellow and some are white on the feedback form now!
Computers have a mind of their own I reakon!