kiepski96
(Krawczyk096)
#1
http://www.restock.xaa.pl/zaproszenia.php
http://www.restock.xaa.pl/informator.php
Po wpisaniu danych i kliknięciu wyślij jest błąd
Jak go naprawić?
Oto kody stron:
http://wklej.org/id/283202/
http://wklej.org/id/283203/
PS. i jak zablokować obrazki,przeciw przesuwaniu jak tło,aby się nie dało zaznaczyć???
ra-v
(ra-v)
#3
Informuje że nagłówki zostały już wysłane i nie mogą zostać wysłane ponownie
Może to pomoże:
header('Location: '.$success_url, true);
kiepski96
(Krawczyk096)
#4
ra-v
(ra-v)
#5
No napisałem że zmień
header('Location: '.$success_url);
na
header('Location: '.$success_url, true);
i zobacz czy jest poprawa.
kiepski96
(Krawczyk096)
#6
Mathew
(Mathew)
#7
To może trochę inwencji własnej i pouczyć się podstaw?
kiepski96
(Krawczyk096)
#8
tak,zabieram się,ale czy koś odpowie?
ra-v
(ra-v)
#9
<?php
ob_start(); ////////////////// wstaw
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$mailto = 'kiepski096@o2.pl';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Powiadomienie na gg';
$message = 'Moje dane to:';
$success_url = './sukces.php';
$error_url = './error.php';
$error = '';
$eol = "\n";
$max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address is invalid!\n
";
}
if (!empty($error))
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $error, $errorcode);
echo $errorcode;
exit;
}
$internalfields = array ("submit", "reset", "send", "captcha_code");
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=iso-8859-1'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
mail($mailto, $subject, $body, $header);
$test = ob_get_contents(); ////////////////// wstaw
mail('twoj@mail.pl', 'WWW', $test); ////////////////// wstaw twój mail!!
header('Location: '.$success_url, true);
exit;
}
[/code]
i sprawdź czy cos przyjdzie na twojego miala.
Ale jeśli wszystko działa, tylko wyświetla ten błąd to daj
[code] @header('Location: '.$success_url, true);