<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)

Closed due to the fact that the question is not clear to the participants by Igor , cheops , aleksandr barakin , Denis , Dmitriy Simushev 15 Sep '16 at 15:03 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • It is necessary to ask you what is wrong? what in logs? - Naumov
  • one
    @Naumov Sorry what the logs? - BedOmar
  • Server logs where errors are written. And yes framework.zend.com/manual/1.11/ru/… read at your leisure. - Naumov
  • @Naumov has nothing in the logs - BedOmar 8:26 pm
  • one
    $result3=='TRUE' not needed. enough if($result3) - Alexey Shimansky

1 answer 1

edited the question and -

 $result3 = mysqli_query(/*...*/) if ($result3=='TRUE') { //ошибка ΠΊΠ°ΠΊ ΠΌΠΈΠ½ΠΈΠΌΡƒΠΌ здСсь, // 'TRUE' != 1 ΠΈ 'TRUE' != true, это условиС Π½ΠΈΠΊΠΎΠ³Π΄Π° Π½Π΅ выполнится. 

for comparison:

 <?php var_dump( 1=='TRUE'); //false var_dump( 1==true); //true 

Besides

closing tag ?> not needed and deemed harmful

  • By the way, 'TRUE' == true, but 'true'! == true, and also 'false' == true, the same string :) - Firepro