
November 5th, 2002, 06:09 PM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Mail Form Verification Problems!
I'm having a problem with a mail form that I'm trying to develop for a Guestbook. I'm new at PHP but I'm really trying to get this thing to work properly.
I have a few fields that need to be verified for data entry. I can get one field to work at a time but I can't get multiple fields to work.
Here's what I'm trying to do. I have a Comments field that needs to be filled in. I can get it to verify no problem. But there is another scenario that needs to be worked out as well. When a certain checkbox field is checked but a certain text entry field is not, I need the script to redirect to another page. The checkbox and the text field both have to be set. If they are both empty - that's OK.
The check box scenario and the Comments scenario are unrelated, but both have to be worked into the script.
Below is my code so far.
comments = Comments text field
info = check box
sendermail = user's email
php Code:
Original
- php Code |
|
|
|
<?php } }else{ $email = "Sender Name:t$namenAddress:t$addressnCity:t$citynProvince -State:t$provnCountry:t$countrynPostal-Zip Code:t$postalnPhone:t$phonenE-Mail:t$senderemailnMessage:t$commentsnInfo:t$infon IP:t$REMOTE_ADDRnn"; $to = "myemail"; $subject = "Guestbook Entry"; $mailheaders = "From: Guestbookn"; $mailheaders .= "Reply-To: $senderemailnn"; mail($to, $subject, $email, $mailheaders); include("thanks.php"); } ?>
Any help with this problem would be much appreciated. Thanks.
|