Ответов: 2 Просмотров: 141
|
Всем привет, подскажите пожалуйста, что за ошибки?
Гуглил - пишут что ошибка из-за того, что символы перед кодом php стоят, но у меня там идет html код.
Причем, на ноутбуке сайт работает нормально, а на компьютере выдает такие ошибки. Почему так? Как исправить?
"Код ошибки на 1 странице" (Отобразить)Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at Z:\home\localhost\www\26 Antibot\Mail.php:31) in Z:\home\localhost\www\26 Antibot\Mail.php on line 51
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:\home\localhost\www\26 Antibot\Mail.php:31) in Z:\home\localhost\www\26 Antibot\Mail.php on line 51
"Код ошибки на 2 странице" (Отобразить)Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at Z:\home\localhost\www\26 Antibot\Sent.php:8) in Z:\home\localhost\www\26 Antibot\Sent.php on line 16
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:\home\localhost\www\26 Antibot\Sent.php:8) in Z:\home\localhost\www\26 Antibot\Sent.php on line 16
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\26 Antibot\Sent.php:8) in Z:\home\localhost\www\26 Antibot\Sent.php on line 35
"Страница 1" (Отобразить)CODE ( htmlphp):
скопировать код в буфер обмена
<!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="Style.css"> </head> <body> <form method="post" action="Sent.php"> <div class="main"> <div class="field"> <label for="theme">Тема письма:</label> <input type="text" name="theme"> </div> <div class="field"> <label for="name">Ваше имя:</label> <input type="text" name="name"> </div> <div class="field"> <label for="ail">Ваш е-мейл:</label> <input type="text" name="ail"> </div> <div class="field"> <label for="phone">Ваш телефон:</label> <input type="text" name="phone"> </div> <div class="field"> <textarea name="message" placeholder="Введите сообщение..."></textarea> </div> <div class="field"> <label for="captcha"> <?php $sum = $rand1 + $rand1; echo $rand1 . " + " . $rand2 . " = "; $_POST["rand1"] = $rand1; $_POST["rand2"] = $rand2; ?> </label> <input type="hidden" name="sum" value="<?php echo $sum; ?>"> <input type="hidden" name="rand1" value="<?php echo $rand1; ?>"> <input type="hidden" name="rand2" value="<?php echo $rand2; ?>"> <input type="text" name="captcha" placeholder="Ответ..."> </div> <div class="field"> <input type="submit" value="Отправить письмо"> </div> </div> </form> <?php if (!empty($_SESSION["theme"])) { echo "<div class='after'>" . $_SESSION["theme"] . "<div>"; unset($_SESSION["theme"]); } if (!empty($_SESSION["name"])) { echo "<div class='after'>" . $_SESSION["name"] . "<div>"; unset($_SESSION["name"]); } if (!empty($_SESSION["ail"])) { echo "<div class='after'>" . $_SESSION["ail"] . "<div>"; } if (!empty($_SESSION["message"])) { echo "<div class='after'>" . $_SESSION["message"] . "<div>"; unset($_SESSION["message"]); } ?> </body> </html>
"Страница 2" (Отобразить)CODE ( htmlphp):
скопировать код в буфер обмена
<!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="Style.css"> </head> <body> <?php if (empty($_POST["theme"]) || empty($_POST["message"]) || $_POST["sum"] != ($_POST["rand1"] + $_POST["rand2"])) { if (empty($_POST["theme"])) { $_SESSION["theme"] = "Введите тему письма."; } if (empty($_POST["name"])) { $_SESSION["name"] = "Введите ваше имя."; } if (empty($_POST["ail"])) { $_SESSION["ail"] = "Введите ваш е-мейл."; } if (empty($_POST["message"])) { $_SESSION["message"] = "Введите сообщение."; } $_SESSION["ail"] = "Е-мейл введен некорректно."; } if ($_POST["sum"] != $_POST["rand1"] + $_POST["rand2"]) { $_SESSION["sum"] = "Капча введена неверно."; } } else { if (empty($_POST["phone"])) { $_POST["phone"] = "Телефон не указан."; } else { $phone = $_POST["phone"]; } $myMail = "test@mail.rus"; $theme = $_POST["theme"]; $name = $_POST["name"]; $message = $_POST["message"]; $ail = $_POST["ail"]; mail($myMail, $theme, $message, "From: " . $ail . ".", "Phone number: " . $phone . "."); echo "Письмо успешно отправлено."; } ?> <form action="Mail.php"> <button>Назад</button> </form> </body> </html>
"ЦСС код" (Отобразить)CODE ( htmlphp):
скопировать код в буфер обмена
* { margin: 0px; padding: 0px; margin-left: 2px; margin-top: 1px; } body { background-color: #dcdcdc; } .field { clear:both; text-align:right; } label { float:left; } div.main { float:left; } textarea { margin-top: 2px; width: 99%; } div.after { margin-top: 3px; }
|