Update contact.php

pull/3/head
to3k 2022-11-29 08:44:08 +01:00 zatwierdzone przez GitHub
rodzic 1cd6f1795a
commit c0553bdcd3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -11,10 +11,9 @@
if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "")
{
$email = addslashes(strip_tags($_POST['form_address']));
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
$check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/';
if(preg_match($check, $email))
if (filter_var($email, FILTER_VALIDATE_EMAIL))
{
if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code'])))
{
@ -27,7 +26,7 @@
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
</head>
<body>
<b>Submitter's address:</b> ".addslashes(strip_tags($_POST['form_address']))."<br>
<b>Submitter's address:</b> ".$email."<br>
<b>Submitter's name:</b> ".addslashes(strip_tags($_POST['form_name']))."<br>
<b>IP:</b> ".addslashes(strip_tags($_POST['ip']))."<br>
<b>Message:</b><br>
@ -36,7 +35,7 @@
</html>";
$subject="Message from Twittodon.com ".date('d-m-Y H:i');
$header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n";
$header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n";
$header .= "From: ".$email."\n";
$address = "contact@twittodon.com";
mail($address, $subject, $message, $header);
@ -330,4 +329,4 @@
</div>
</body>
</html>
</html>