hallo,
met contact.php is alles in orde,
dus hij gaat naar mail.php
en het bericht wordt gestuurd!
maar als niet alles is ingevuld, laat ik een alert message zien.
als ze dan op ok klikken, wil ik dat ze terug naar contact.php worden verzonden,
maar dit is dus niet het geval
code:
PHP
<?php
$youremail = "[email protected]";
$subject = "design world - contact";
$thankyou = "thanks.html";
if(empty($_POST['email']) || empty($_POST['name']) || empty($_POST['message'])){
?>
<script type="text/javascript">
function notify() {
alert("Niet alle verplichte velden zijn ingevuld, graag aanpassen en nogmaals op de warrior klikken.");
return false;
}
window.onload = notify
</script>
<?php
}
else {
$headers = 'From: [email protected]' . "rn" .
'Reply-To: [email protected]' . "rn" .
'X-Mailer: PHP/' . phpversion();
mail($youremail, $subject, $_POST['message'], $headers);
header('Location: '.$thankyou);
}
?>
Toon Meer
Alvast bedankt!
online versie:
http://testing4334.comuv.com/test/contact.html