Form Validation

Newbie Member
20Sep2011,09:43   #1
starr05's Avatar
I am new to php and I was suggested that I use form validation in my php, but I dont know how. Anyone willing to help?

This is what I got so far that works:

PHP Code:

<?php
$first_name
=$_POST['name'];
$email_address=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['text'];

mail("myemailaddres@gmail.com","Subject: $subject",
$message,"From: $first_name <$email_address>");

echo 
"Thank you for using our mail form.<br/>";
echo 
"Your email has been sent.";
?>
Ambitious contributor
23Sep2011,04:33   #2
pein87's Avatar
Basically you need to validate the data being send to the script. You can find a bunch of free validaters for text, email, phone numbers, ip etc...
Newbie Member
23Sep2011,04:51   #3
starr05's Avatar
Thanks!
Contributor
3Dec2011,23:51   #4
c_user's Avatar
The above code sends an email to e-mail address provided by the user..
Light Poster
25Jan2012,20:35   #5
raju_mars's Avatar
Your website user send mail to u....