Hi,
I’m new here and new to PHP.
I have created a script to send form data by e-mail, i have uploaded the script to the hosting server (network solutions) but when i fill out the form and submit it it just displays a blank screen.
here is my script
<?php $errors = ''; $myemail = '[email protected]';//<----- Put your email address here. if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['course_location']) || empty($_POST['address'])) { $errors .= "\n Error: all fields are required"; } $name = $_POST['name']; $email = $_POST['email']; $course_location = $_POST['course_location']; $address = $_POST['address']; if (!preg_match( "~^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.a-z0-9-]+)*(\.[a-z]{a-z})$/i~",$email)) { $errors .= "\.n Error: Invalid email address"; } if( empty($errors)) { $to = $myemail; $email_subject = "Booking form submission: $name"; $email_body = "You have received a new booking.". " Here are the details:\n Name: $name \n ". "Email: $email\n Course Location \n $course_location Address \n $address"; $headers = "From: [email protected]"; $headers .= "Reply-To: $email"; mail($to,$email_subject,$email_body,$headers); //redirect to 'thank you' page header("Location: http://high-flyerz.com/booking_form_thank_you.html"); } ?>