// For error checking on required fields you will need to put this somewhere in // contact.inc.php to alert the user that there are entry errors: // echo $required; <-- this needs to be inside php tags. // Create the "if" statements below for each field you want to validate. // Set the two variables below. // This is who gets emailed with the contents when the form is submitted $email_form_to = "diane@childsafenet.org"; //This appears in the subject line when the form gets emailed. $email_form_subject = "Contact Request from {$_SERVER['SERVER_NAME']}"; if( $action == "submitted" ){ $required = ""; /* if( $name == "" ){ */ /* $required .= "Name is a required field
"; */ /* } */ /* if( $address1 == "" ){ */ /* $required .= "Address is a required field
"; */ /* } */ /* if( $city == "" ){ */ /* $required .= "City is a required field
"; */ /* } */ /* if( $state == "" ){ */ /* $required .= "State is a required field
"; */ /* } */ /* if( $zip == "" ){ */ /* $required .= "Zip is a required field
"; */ /* } */ /* if( $phone == "" ){ */ /* $required .= "Phone is a required field
"; */ /* } */ /* if( $email == "" ){ $required .= "Email is a required field
"; } */ if( $required == "" ){ $body .= "Full name: ".$name."\n"; $body .= "Address1: ".$address1."\n"; $body .= "Address2: ".$address2."\n"; $body .= "City/State: ".$city."\n"; $body .= "Zip: ".$zip."\n"; $body .= "Phone: ".$phone."\n"; $body .= "Fax: ".$fax."\n"; $body .= "Email: ".$email."\n"; $body .= "Volunteer List: ".$vol_list."\n"; $body .= "Volunteer Grants: ".$vol_grants."\n"; $body .= "Volunteer Booth: ".$vol_booth."\n"; $body .= "Volunteer Charity Event: ".$vol_charit_event."\n"; $body .= "Volunteer News Watchdog: ".$vol_news_watchdog."\n"; $body .= "Volunteer Fundraiser: ".$vol_fundraiser."\n"; $body .= "Volunteer Writer: ".$vol_writer."\n"; $body .= "Volunteer Corp Liason: ".$vol_corp_liason."\n"; $body .= "Volunteer Speaker: ".$vol_speaker."\n"; $body .= "Comments: ".$comments."\n"; mail( $email_form_to, $email_form_subject, $body, "From: $email\r\n"."Reply-To: $email\r\n"."X-Mailer: PHP/" . phpversion() ); include("thankyou.inc.php"); } } if( $action == "" || $required != ""){ include("yourHelp.inc.php"); } ?>