I have a problem with my PHP script. It should work like this: User fills in details for reservation -> sends details to preservation.php.
If the amount of persons is larger than six, it should prevent the data from entering the database. At the same time is should resend the filled in details to the original form, so the user can edit the details.
But what happens is that the header sends preservation.php back as a download (The content is in HTML, no PHP).
$username = $_POST['username'];
$name = $_POST['name'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$date = $_POST['date'];
$time = $_POST['time'];
$pers = $_POST['pers']; //Amount of persons
$comment = $_POST['comment'];
if($pers >= 7){
$post_date = 'test=test'; //Just to test the script
$content_length = strlen($post_data);
header('POST reservation.php');
header('Host: localhost');
header('Connection: close');
header('Content-type: application/x-www-form-urlencoded');
header('Content-length: ' . $content_length);
header('');
header($post_data);
header('Location: reservation.php');
}