|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP Form Validation
Hey guys - I just needed your help for a quick question.
I have a form located at http://www.dreamnation.ca/testing/a...egistration.php If you submit the form without filling out any fields, I get an error page. Is there a way that I can write or add certain php lines of code, that indicates which fields are required, and turns the text "bold red" if a required field is missed? So that the form isn't submitted without all the neccessary data? Your help would be great.... thanks in advance. |
|
#2
|
|||
|
|||
|
Are you sending the posted data to the right script?
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
yes - I am using a php script that determines where the data goes
THIS IS WHAT MY RESPONSE.PHP PAGE LOOKS LIKE: <?php include '../header.php'; ?> <?php $mailTo="bball@ahmadiyya.ca"; $mailSubject="AMBI Web Site - Team Registration"; $mailBody=$mailBody."Team Name: " .$teamname. "\n"; $mailBody=$mailBody."Captains Name: " .$captainname."\n"; $mailBody=$mailBody."Captains Address: " .$captainaddress. "\n"; $mailBody=$mailBody."Captains Phone: " .$captainphone. "\n"; $mailBody=$mailBody."Captains Email: " .$captainemail. "\n"; $mailBody=$mailBody."Comments: " .$comments. "\n"; mail($mailTo, $mailSubject, $mailBody, $mailHeaders); ?> <html> <head> <title> Response Page - Blast Entertainment </title> <head> <body bgcolor="#ffffff"> <font face="arial,helvetica,sans-serif" size="4" color="red"> <b> Submitted </b> </font> <p> <font face="arial, helvetica, sans-serif" size=2"> Your information has been submitted! Thank you! <p> <a href=http://www.dreamnation.ca/testing/abi/page.php> Return to Main Page </a> </font> <?php include '../footer.php'; ?> </body> </html> Last edited by kh44na : June 5th, 2003 at 04:22 PM. |
|
#4
|
|||
|
|||
|
First - this is wrong:
PHP Code:
Should be: PHP Code:
Now, you have $mailHeaders in the mail function - but I don't see where you defined the mail headers. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP Form Validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|