Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST[submit])){
- $error='';//set $error to blank
- if(strlen($_POST[FirstName]) == 0){
- $errorFname.="A Valid First Name Is Required!<br />";
- }
- if(strlen($_POST[LastName]) == 0){
- $errorLname.="A Valid Last Name Is Required!<br />";
- }
- if(strlen($_POST[CompanyName]) == 0){
- $errorCname.="A Valid Company Name Is Required!<br />";
- }
- if(strlen($_POST[CompanyAddress]) == 0){
- $errorCaddress.="A Valid Address Is Required!<br />";
- }
- if(strlen($_POST[CompanyCity]) == 0){
- $errorCcity.="A Valid City Is Required!<br />";
- }
- if(strlen($_POST[CompanyState]) <> 2){
- $errorCstate.="A Valid State Is Required!<br />";
- }
- if(trim($_POST[CompanyZip])=='' || strlen(trim($_POST[CompanyZip])) <> 5){
- $errorCzip.="A Valid Zip Code is Required!<br />";
- }
- if(strlen($_POST[CompanyWebsite]) < 3){
- $errorCwebsite.="Please enter a valid Website!<br />";
- }
- if(trim($_POST[CompanyEmail])==''){
- $errorCemail.="An email address is required!<br />";
- }
- else{
- if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST[CompanyEmail])) {
- $errorCemail2="The e-mail you entered was not in the proper format!";
- }
- }
- if($errorFname=='' AND $errorLName=='' AND $errorCName=='' AND $errorCAddress=='' AND $errorCState=='' AND $errorCZip=='' AND $errorCWebsite=='' AND $errorCEmail=='' AND $errorCEmail2==''){//no text is in $error, the page has verified
- $pass="1";
- }else{
- echo "<span style=color:red>$error</span>";
- $pass="0";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement