Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\check1.php:26) in C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\login.php on line 54 Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\check1.php:26) in C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\login.php on line 55 Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\check1.php:26) in C:\Program Files\Apache Group\Apache2\htdocs\radiotochka\login.php on line 58
# Ставим куки setcookie("id", $data['user_id'], time()+60*60*24*30); setcookie("hash", $hash, time()+60*60*24*30); # Переадресовываем браузер на страницу проверки нашего скрипта header("Location: check.php?act=login"); exit();
<?php include "db.php"; $id = $_COOKIE['id']; $query = mysql_query("SELECT * FROM users where user_id='$id'"); $userdata = mysql_fetch_array($query); echo "Твой Кошелек - ".$userdata['wmr']." <a href='?ed=wmr'>Изменить</a></br>"; echo "Твой ICQ - ".$userdata['icq']." <a href='?ed=icq'>Изменить</a></br>"; echo "Твой E-mail - ".$userdata['email']." <a href='?ed=email'>Изменить</a></br>"; echo "<br>"; switch ($_GET[ed]) { case "wmr": $edit = $userdata['wmr']; echo "Изменить $_GET[ed] <form action='edit.php' method='get' name='name'> <input name='edit' type='text' value=$edit> <Br><input name='sub' type='button' value='Сохранить'> </form>"; break; case "icq": $edit = $userdata['icq']; echo "Изменить $_GET[ed] <form action='edit.php' method='get' name='name'> <input name='edit' type='text' value=$edit> <Br><input name='sub' type='button' value='Сохранить'> </form>"; break; case "email": $edit = $userdata['email']; echo "Изменить $_GET[ed] "; break; } ?>
if(isset($_GET['edit'])){ $new = $_GET['edit']; $id = $_COOKIE['id']; $result = mysql_query ("UPDATE users SET $edit='$new' WHERE user_id='$id'"); echo "Операция успешна"; }