$time= $_GET['time']; $pos = $_GET['pos']; if ($time <10) {$dtime = "0".$time.":00";} else {$dtime = $time.":00";} //var_dump($_REQUEST); $fname = $_POST['fname']; $sname = $_POST['sname']; $email = $_POST['email']; if (strlen($_POST['fname'])>1 AND strlen($_POST['sname'])>1 AND strlen($_POST['email'])>1 ) { $dbwu = "frfuncom_dbadmin"; $dbwp = "DB_Admin1"; $db = "frfuncom_charity"; $con=mysqli_connect("",$dbwu,$dbwp,$db); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Assuming there's no problem... $sql = "INSERT INTO Entries (fname, sname, email, time, pos, status, other) VALUES ('".$fname."','".$sname."','".$email."','".$time."','".$pos."',1,0)"; //echo $sql; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } if ($time > 0 AND $time <15) { $day = "Saturday 20 July";} else {$day = "Friday 19 July";} $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: tournaments@southamptonarcheryclub.org' . "\r\n"; $headers .= 'Reply-To: tournaments@southamptonarcheryclub.org' . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); mail($email,"Charity slot booked", "
Hi " . $fname . "
Your slot has been booked for ".$day." at ".$dtime. " in position " . $pos . ".
Please let us know by replying to this email if you need to change your slot.
Best
Steve Ritzema
Southampton Archery Club