PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 5th, 2002, 06:09 PM
bobamike bobamike is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 bobamike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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
  1.  
  2. <?php 
  3. if (empty($comments)) {
  4.     header( "Location: URL" )
  5. }
  6. elseif (isset($info) || empty($sendermail)) {
  7.     header( "Location: URL" );
  8.  
  9. }else{ 
  10.  
  11. $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";
  12. $to = "myemail";
  13. $subject = "Guestbook Entry";
  14. $mailheaders = "From: Guestbookn";
  15. $mailheaders .= "Reply-To: $senderemailnn";
  16. mail($to, $subject, $email, $mailheaders);
  17. include("thanks.php");
  18. }
  19. ?>


Any help with this problem would be much appreciated. Thanks.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Mail Form Verification Problems!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway