Tech Support > Computers & Technology > Programming > CGI/Perl form Help!!
CGI/Perl form Help!!
Posted by Tone Southerland on September 6th, 2003


I'm having a problem getting a form to work on my web page and thought
maybe someone could help. I downloaded a Perl script from Matt's
script archive(credible source). I put the .html form file in my
public_html directory (where the rest of my web pages live) then I put
the .pl file in the cgi-bin directory where it should go. I chmoded
the guestbook.pl file to 755 and also chmoded it to a+rx. Not sure if
these 2 do the same thing but I did both just in case they are
different.

I then asked my server admin what directory Perl is in and for the
full path of my website. So he gave me:

For Perl -- /usr/bin/perl

For website -- /home/anchored/pblic_html/cgi-bin



Using this info I made appropriate changes to guestbook.pl file (code
snippet below):

#!/usr/bin/perl
################################################## ##########################
#Set Variables
$guestbookurl = "http://www.anchoredstone.com/guestbook.html";
$guestbookreal = "/home/anchored/public_html/guestbook.html";
$guestlog = "/home/anchored/public_html/guestlog.html";
$cgiurl = "http://www.anchoredstone.com/~anchored/cgi-bin/guestbook.pl";
$date_command = "/usr/bin/date";

Ok. So now I go to access the form and fill something out and hit the
submit button but I get a server not found error. The address at the
top of the browser window reads
http://your.host.com/cgi-bin/guestbook.pl. Which is the dummy link
placed in the Perl script I downloaded. So is it pointing to the
wrong address because I edited on my computer then uploaded? Do I
have to edit it on the server for the form to work?

Any help on this is much appreciated,

Tone

Posted by Josh Sebastian on September 6th, 2003


On Sat, 06 Sep 2003 09:21:28 -0700, Tone Southerland wrote:

We could probably help more if you showed us the full source of the .pl
file.

Posted by Arthur J. O'Dwyer on September 6th, 2003



On Sat, 6 Sep 2003, Tone Southerland wrote:
Now, I am not a Unix expert, but I believe that if chmod 755 is
equivalent to the pseudo-C code

permissions = 0755;

then chmod a+rx is equivalent to

permissions |= 0555;

which doesn't do the same thing, but doesn't change anything either,
assuming you've already done 'chmod 755'. So it's harmless.


Cut and paste, man, cut and paste! Don't retype!


You have to edit the HTML file, too, so that the link you clicked
points to the correct location in your cgi-bin directory. Then
upload everything, and remember to chmod 755 again.

HTH.
-Arthur


Similar Posts