Making this slightly advanced form script.
Sends the users input to the webmaster and can store it in a file if the host wants it to.
I also added a bad word checker, based on one I got at this forum not long ago.
But I have some problems. For the first. I can't seem to get the email to be send while I'm doing this: I have a variable named $recipient.
It contains my email address. I have placed the variable to be printed after the To: in the sendmail sub.
But I get this message over the thank you page(?!).
Really strange. It displays the thank you page, but it doesn't send the email!
This has never happened to me before. If I just type my address in the To: print sentence it works fine.
Really weird!
The next thing is the checking of the email address the user post.
blackout("The email you entered was invalid. Please go back and try again.\n");}
}It works fine. (Thank you Paul for posting it here earlier.) But, yes BUT, there is one thing. A friend of mine asked me if this code would stop someone from just typing something like xxx@xxx.com.
Ehh...I tried. Nope. Maybe that ain't possible?
Just a thought, Paul.
The third is the checking of message. That one doesn't work at all. It sends the message even if I don't have filled in anything!
That don't work. I'm not sure if I posted enough for you to understand. I have tested it, even with and without use strict; With strict tons of error comes up and it I get this typical sever error when trying it.
Any tips? I don't won't to post the full script here yet. I might publish it later for free, but I want to keep the code mostly for myself for a while.
Thanks.
- perlman
Sends the users input to the webmaster and can store it in a file if the host wants it to.
I also added a bad word checker, based on one I got at this forum not long ago.
But I have some problems. For the first. I can't seem to get the email to be send while I'm doing this: I have a variable named $recipient.
It contains my email address. I have placed the variable to be printed after the To: in the sendmail sub.
But I get this message over the thank you page(?!).
Quote:
No recipient addresses found in headerReally strange. It displays the thank you page, but it doesn't send the email!
This has never happened to me before. If I just type my address in the To: print sentence it works fine.
Really weird!
The next thing is the checking of the email address the user post.
Code:
if ($FORM{'emailfrom'} !~ /\S+@\S+\.\S+/) { blackout("The email you entered was invalid. Please go back and try again.\n");}
}
Ehh...I tried. Nope. Maybe that ain't possible?
Just a thought, Paul.
The third is the checking of message. That one doesn't work at all. It sends the message even if I don't have filled in anything!
Code:
if(!$FORM{'message'}) {blackout("You must write something! Or else the meaning of filling out this form is waisted. Please go back.\n");}That don't work. I'm not sure if I posted enough for you to understand. I have tested it, even with and without use strict; With strict tons of error comes up and it I get this typical sever error when trying it.
Any tips? I don't won't to post the full script here yet. I might publish it later for free, but I want to keep the code mostly for myself for a while.
Thanks.
- perlman