Click to See Complete Forum and Search --> : Please help! CGI Form Script Forms


paul_sutt
09-28-2006, 03:55 AM
Hi,

I'm new to this and have just nearly completed my first CGI script. I used BNB form first..process everything and returned a thanks page..but did not send any email data. So tried novice forms..same result...script runs ok, but email data is not being sent.

I believe then it may have something to do with sendmail or SMTP. Checked perl address and sendmail dir with host and they have told me they are correct, so i'm stuck!

I've attached the novice forms cgi script below (the editable part)

..please help!





#!/usr/bin/perl
## make sure the path to pearl is correct above. ##

##########################################################################################
## FILE: novice.cgi ##
## ##
## Novice Forms Version 1.1 ##
## © Copyright 2000-2003 Seth Michael Knorr mail@sethknorr.com ##
## ##
## http://www.noviceforms.com/ ##
## Please contact me with any bugs found, or any bug fixes. ##
## ##
## This script is a spin off of the original ©Biz Mail Form ##
## ##
##########################################################################################
## ##
## There is no email support provided for this script, the only support can be ##
## found at our web site: http://www.noviceforms.com/ ##
## ##
## ##
## ANY PERSON(S) MAY USE AND MODIFY THESE SCRIPT(S) FREE OF CHARGE FOR EITHER BUSINESS ##
## OR PERSONAL, HOWEVER AT ALL TIMES HEADERS AND COPYRIGHT MUST ALWAYS REMAIN IN TACT. ##
## ##
## REDISTRIBUTION FOR PROFIT IS PROHIBITED WITH OUT THE CONSENT OF SETH KNORR. ##
## ##
## By using this code you agree to indemnify Seth M. Knorr from any liability that ##
## might arise from its use. ##
## ##
## ##
##########################################################################################


## $sendto and $ccto is Where form submissions will be sent, ##
## (REMEMBER THE \ BEFORE THE @ SIGN example: \@) ##
## $sendto = "sendto\@yourdomain.com"; CORRECT WAY!!!! ##
## $sendto = "sendto@yourdomain.com"; WILL NOT WORK!!!! ##


$sendto = "paul_sutton123\@yahoo.co.uk"; ## (REMEMBER THE \ BEFORE THE @ SIGN)##

$ccto = "paul_sutton123\@yahoo.co.uk"; ## (REMEMBER THE \ BEFORE THE @ SIGN)##



## $useLib defines the method of sending the email form info to you. ##
## Set $useLib = "sendmail"; TO USE THE SENDMAIL METHOD ##
## Set $useLib = "smtp"; TO USE THE SMTP METHOD ##

$useLib = "sendmail";

$mailprog = "/usr/sbin/sendmail"; ## $mailprog Is the path to sendmail on your server ##

$smtp = "smtp.host.com"; ## Optional $smtp is your smtp server address ##
## example: smtp.host.com ##
## You only configure this is not using sendmail ##


## to use @okurls to verify the url the form is submited by; set $setokurl to 1 and ##
## set $setokurl to 0 if you do not want to use @okurls to verfiy form submission URL ##

$setokurl = "0";

@okurls = ("http://www.yourdomain.com", "http://yourdomain.com", "34.344.344.344");



####################################################################################################
############# #############
############# N O N E E D T O E D I T A N Y V A R I A B L E S B E L O W #############
############# #############
####################################################################################################

Nedals
09-28-2006, 07:22 PM
I get very suspicious of scripts that do not use strict, and even more suspicious when the author does not know how to spell 'Perl'.

At a guess....
# $smtp = "smtp.host.com"; # comment out
$setokurl = 0; # no quotes

paul_sutt
09-29-2006, 04:23 AM
thanks for your reply...I've managed to fix the script myself, the error being in the email address having an _ which either the script or server..i don't know, didn't like.

Once again thanks for your reply.

Nedals
09-29-2006, 10:08 AM
Glad you got it working.

In your pre-edited reply, which is automatically emailed, you stated....

thanks for your reply, including the not called for comment.....
Followed by a few rather rude comments of your own.....

You stated that you are new at this. I was only letting you know there are a lot of very pooly written scripts out there and just be cautious. Secondly the reference to the spelling error referers to the 'pearl' which I thought was part of Seth Michael Knorr's.

paul_sutt
09-29-2006, 10:17 AM
I really do apologise, which is why i removed my response. I got the wrong end of the stick and thought you were referring to my rather basic question and grasp of the problem. After re-reading your thread i realised you were referring to the author of the program.

Anyway thankyou for your help and sorry for mix up.

regards

paul