<form action='update_user' method='post'> <input class='auth_input' name='login' type='text'> <input class='auth_button' type='submit' name='submit'> </form> <? $f_log = mysqli_query($db, "SELECT * FROM users WHERE activation = '1'"); $f_log_r = mysqli_fetch_array($f_log); $login = $_POST['login']; $login = stripslashes($login); $login = htmlspecialchars($login); $login = trim($login); if (isset($_POST['login'])){ if (empty($login)) { $empty_data = 1;} else{ if ($f_log_r['login'] == $login) {$reg_login = 1;} else{ if (strlen($login) < 3 or strlen($login) > 16) {$too_long = 1;} else{ $result3 = mysqli_query($db, "UPDATE users SET login='$login' WHERE login='$old_login'"); if ($result3=='TRUE') { //ΠΎΡΠΈΠ±ΠΊΠ° ΠΊΠ°ΠΊ ΠΌΠΈΠ½ΠΈΠΌΡΠΌ Π·Π΄Π΅ΡΡ, 'TRUE' != 1 ΠΈ != true, ΡΡΠΎ ΡΡΠ»ΠΎΠ²ΠΈΠ΅ Π½ΠΈΠΊΠΎΠ³Π΄Π° Π½Π΅ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡΡ mysqli_query($db, "UPDATE messages SET author='$login' WHERE author='$old_login'"); $_SESSION['login'] = $login;//ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌ Π»ΠΎΠ³ΠΈΠ½ Π² ΡΠ΅ΡΡΠΈΠΈ if (isset($_COOKIE['login'])) { setcookie("login", $login, time()+9999999);//ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅ΠΌ Π»ΠΎΠ³ΠΈΠ½ Π² ΠΊΡΠΊΠ°Ρ
} $data = 1;}//ΠΎΡΠΏΡΠ°Π²Π»ΡΠ΅ΠΌ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ Π½Π°Π·Π°Π΄ } } } }
what is the error (s)
$result3=='TRUE'
not needed. enoughif($result3)
- Alexey Shimansky