Gossamer Forum
Home : General : Perl Programming :

form script problems

Quote Reply
form script problems
 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(?!).
Quote:
No recipient addresses found in header

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.
Code:
if ($FORM{'emailfrom'} !~ /\S+@\S+\.\S+/) {
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!
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
Subject Author Views Date
Thread form script problems perlman 8000 Jun 16, 2003, 5:06 AM
Thread Re: [perlman] form script problems
Andy 7881 Jun 16, 2003, 6:35 AM
Thread Re: [Andy] form script problems
Paul 7891 Jun 16, 2003, 6:41 AM
Thread Re: [Paul] form script problems
Andy 7846 Jun 16, 2003, 6:47 AM
Thread Re: [Andy] form script problems
Wil 7865 Jun 16, 2003, 7:19 AM
Thread Re: [Wil] form script problems
Andy 7872 Jun 16, 2003, 7:48 AM
Thread Re: [Andy] form script problems
Wil 7864 Jun 16, 2003, 8:01 AM
Thread Re: [Wil] form script problems
cK 7836 Jun 16, 2003, 8:52 AM
Thread Re: [cK] form script problems
Wil 7900 Jun 16, 2003, 9:03 AM
Post Re: [Wil] form script problems
cK 7833 Jun 16, 2003, 9:10 AM