PHP: <?php if(isset($_POST['go'])){ if($_POST['login']=="admin" && $_POST['pass']=="admin"){ session_start(); $_SESSION['user']="true"; header("Location:admin.php"); } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Авторизация</title> <link href="style/style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="forma"> <form action="index.php" method="post"> <p> <input class="none" onmouseover="this.className='light'" onmouseout="this.className='none'" type="text" name="login" placeholder="Логин"> </p> <p> <input class="none" onmouseover="this.className='light'" onmouseout="this.className='none'" type="password" name="pass" placeholder="Пароль"> </p> <input id="sub" type="submit" name="go" value="Войти" /> </form> </div> </body> </html> пищу вот такую авторизацию, но она как ни крути не работает! Выдает ошибку Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at Q:\home\site.tk\www\admin\index.php:1) in Q:\home\site.tk\www\admin\index.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Q:\home\site.tk\www\admin\index.php:1) in Q:\home\site.tk\www\admin\index.php on line 4 Warning: Cannot modify header information - headers already sent by (output started at Q:\home\site.tk\www\admin\index.php:1) in Q:\home\site.tk\www\admin\index.php on line 6 Помогите, пожалуйста, заранее спасибо!
Скорее всего BOM попадается. Очень часто такая проблема у новичков возникает. Ну не поленись уж сам поискать на форуме аналогичные вопросы.
Спасибо, нашел, исправил, все заработало. Огромное спасибо, я раньше и не знал, что такая проблема существует!