Miscellaneous > Programming & Networking
perl training wheels
Master of Reality:
can anyone see whats wrong with this:
i dont plan to really use this script. It was just part of tutorial stuff.
--- Code: ---
--- End code ---
[ September 22, 2002: Message edited by: The Master of Reality / Bob ]
voidmain:
Try and run it on the command line, it will tell you where your errors are.
Line 9 is missing an ending quote and a semicolon. And while you are at it you might as well set line 9 to what your sendmail program is (probably /usr/lib/sendmail):
$sendmail = "/usr/lib/sendmail";
Line 24 just doesn't make any sense. Looks like what is missing from line 9, comment it out:
#usr/lib/sendmail";
Line 33 is missing a semicolon:
chop($date);
Line 88 is screwed, turn it into this:
--- Code: ---
--- End code ---
So now it should look like this:
--- Code: ---
--- End code ---
Actually there was some repeated shit at the top that I got rid of. Now, that fixes the syntax problems. You also need to make sure the program will have write access to the log file you have assigned in the program.
And of course you'll need the configuration file that the program uses which is an empty ~/.allowmailform file in the home directory of the user that is to receive messages from this CGI. That file needs to be readable by the web server which means the user must also have at least the execute bit turned on in their home directory for world.
I just created a basic HTML form that calls this CGI and it worked. It sent mail to my local account. So you'll need to write an HTML form to use it.
[ September 22, 2002: Message edited by: void main ]
Master of Reality:
after looking over my post agin... i ma sure that i copied that completely wrong...or at least the parts about sendmail that dont make sense.
[ September 22, 2002: Message edited by: The Master of Reality / Bob ]
voidmain:
Well like I said, it works. Just had to create a simple HTML form page to test it:
--- Code: ---
--- End code ---
Of course you'll probably not want fields for a couple of them and would want to hard code values using "<input type=hidden>" tags...
[ September 22, 2002: Message edited by: void main ]
Master of Reality:
--- Code: ---
--- End code ---
this is the form i have:
--- Code: ---
--- End code ---
edit: fixed
[ September 22, 2002: Message edited by: The Master of Reality / Bob ]
[ September 23, 2002: Message edited by: The Master of Reality / Bob ]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version