Mam problem kiedyś przygotowywałem popup miałem problem z refreshowaniem gdy wyslalem maila, zastosowałem wtedy header, tyle ze nie wiem czy coś poknociłem, ale ogolnie on sie nie wykonuje. a chce aby nie bylo mozliwosci wysylania tych samych wiadomosci podczas odswiezania
<?php
if(isset($_POST['submit'])) {
if($_POST['js']!='true'){ // jeśli nie (ukryte pole będzie różne od true)
echo'<div id="php_error">Please turn on javascript in your browser and refresh website</div>'; echo "<meta http-equiv='refresh' content='4;url= ". strip_tags($_SERVER['PHP_SELF']) ."'>";
}
else{
$to = 'ffsdfsd@sf.pl';
@$phone = $_POST['phone'];
date_default_timezone_set('Europe/Warsaw');
$date = date('Y-m-d H:i:s'); // message
$message = '<html><body>';
$message .= '<table width="100%" border="0" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td width='50'><strong>Temat</strong> </td><td>Prośba o kontakt</td></tr>";
$message .= "<tr style='background: #f9f9f9;'><td ><strong>Numer Telefonu</strong> </td><td>" . strip_tags($_POST['phone']) ." </td></tr>"; $message .= "<tr style='background: #eee;'><td width='50'><strong>Wysłano</strong> </td><td>".$date."</tr>";
$message .= "</table>";
$message .= "*Mail został wygenerowany w sprawie prośby o kontakt na wskazany numer telefonu.";
$message .= "</body></html>";
// To send HTML mail, the Content-type header must be set
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/html; charset=UTF-8' . "\r\n";
//$headers = "From: " . strip_tags($_POST['phone']) . "\r\n";
mail($to, 'Prośba o kontakt['.$phone.']', $message, $headers);
}
}
?>