nie wiem, czy to dobry dział ale... ale juz mówię w czym problem..
tworzę formularz w swishu z plikiem contact.php
I nie wiedząc dlaczego dostaję pustego maila..
Mój kod źródłowy .php wygląda następująco:
Kod
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="author" content="[ Autor dokumentu ]" />
<meta name="description" content="[ Opis dokumentu ]" />
<meta name="generator" content="EdHTML" />
<title>[ Tytul dokumentu ]</title>
</head>
<body>
<?php
$name = stripslashes($nameVar);
$email = stripslashes($emailVar);
$subject1= stripslashes($subjectVar);
$telephone=striplashes($telephoneVar);
$message = stripslashes($msgVar);
$rec_email = "admin@k3y.pl";
$subject = "Mail ze strony Rotronika";
$msg_body = "<html><head><meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\" /></head><body>";
$msg_body = "<font face=\"Verdana\" size=\"2\">";
$msg_body .= "<i>Wiadomość z: <a href=\"$SERVER_NAME\">$SERVER_NAME</a></i><br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<b>Podpis:</b> $name<br>";
$msg_body .= "<b>E-Mail:</b> <a href=\"mailto:$email\">$email</a><br>";
$msg_body .= "<b>Telefon:</b> $telephone<br>";
$msg_body .= "<b>Temat:</b> $subject1<br>";
$msg_body .= $message."<br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<br><br>";
$msg_body .= "<i>Doadatkowe informacje o nadawcy:</i><br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<b>Adres IP:</b> $REMOTE_ADDR<br>";
$HostName = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$msg_body .= "<b>Nazwa hosta:</b> $HostName<br>";
$msg_body .= "<b>Agent HTTP:</b> $HTTP_USER_AGENT<br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "</font></body></html>";
$header_info = "MIME-Version: 1.0\r\n";
$header_info .= "Content-type: text/html; charset=UTF-8\r\n";
$header_info .= "From: ".$name." <".$email.">";
mail($rec_email, $subject, $msg_body, $header_info);
echo "&errormessage=Dziekujemy! Wiadomosc zostala wyslana poprawnie!&";
?>
</body></html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="author" content="[ Autor dokumentu ]" />
<meta name="description" content="[ Opis dokumentu ]" />
<meta name="generator" content="EdHTML" />
<title>[ Tytul dokumentu ]</title>
</head>
<body>
<?php
$name = stripslashes($nameVar);
$email = stripslashes($emailVar);
$subject1= stripslashes($subjectVar);
$telephone=striplashes($telephoneVar);
$message = stripslashes($msgVar);
$rec_email = "admin@k3y.pl";
$subject = "Mail ze strony Rotronika";
$msg_body = "<html><head><meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\" /></head><body>";
$msg_body = "<font face=\"Verdana\" size=\"2\">";
$msg_body .= "<i>Wiadomość z: <a href=\"$SERVER_NAME\">$SERVER_NAME</a></i><br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<b>Podpis:</b> $name<br>";
$msg_body .= "<b>E-Mail:</b> <a href=\"mailto:$email\">$email</a><br>";
$msg_body .= "<b>Telefon:</b> $telephone<br>";
$msg_body .= "<b>Temat:</b> $subject1<br>";
$msg_body .= $message."<br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<br><br>";
$msg_body .= "<i>Doadatkowe informacje o nadawcy:</i><br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "<b>Adres IP:</b> $REMOTE_ADDR<br>";
$HostName = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$msg_body .= "<b>Nazwa hosta:</b> $HostName<br>";
$msg_body .= "<b>Agent HTTP:</b> $HTTP_USER_AGENT<br>";
$msg_body .= "<hr width=\"100%\" size=\"1\" color=\"#333333\"><br>";
$msg_body .= "</font></body></html>";
$header_info = "MIME-Version: 1.0\r\n";
$header_info .= "Content-type: text/html; charset=UTF-8\r\n";
$header_info .= "From: ".$name." <".$email.">";
mail($rec_email, $subject, $msg_body, $header_info);
echo "&errormessage=Dziekujemy! Wiadomosc zostala wyslana poprawnie!&";
?>
</body></html>
Pomimo iż formularz został w całości wypełniony to otrzymuję maila takiego jakby nie były wypełnione pola (pomimo tego iż są..)
Czy drodzy fachowcy widzicie gdzies błąd w kodzie?
pozdrawiam
Michał