Se devi dare dei consigli, almeno assicurati che siano corretti.
Codice PHP:
<?php
$post1 = isset($_POST['post1']) ? trim($_POST['post1']) : '';
$post2 = isset($_POST['post2']) ? trim($_POST['post2']) : '';
$post3 = isset($_POST['post3']) ? trim($_POST['post3']) : '';
$post4 = isset($_POST['post4']) ? trim($_POST['post4']) : '';
if (empty($post1) || empty($post2) || empty($post3) || empty($post4)) {
echo "Spiacente, ma tutti i campi sono obbligatori.
<a href=\"java-script:history.back()\">Indietro</a>";
} else {
/*
resto dello script
*/
}
?>