Проверка - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Проверка.php

  1. <?php
  2. $authorized = false;
  3. if(isset($_COOKIE['mail']) && isset($_COOKIE['password'])) {
  4.                 if(filter_var($_COOKIE['mail'], FILTER_VALIDATE_EMAIL) && !empty($_COOKIE['mail']) && !empty($_COOKIE['password']) && mb_strlen($_COOKIE['mail'],'UTF-8')>3 && mb_strlen($_COOKIE['mail'],'UTF-8')<64 && mb_strlen($_COOKIE['password'],'UTF-8')>3 && mb_strlen($_COOKIE['password'],'UTF-8')<64) {
  5.  
  6.                         $mail=trim($_COOKIE['mail']);
  7.                         $password=$_COOKIE['password'];
  8.                        
  9.                         $res9 = $dbh->prepare("SELECT * FROM `users` WHERE `mail`=:mail and `password`=:password");
  10.                         $res9->execute(["mail" => $mail, "password" => $password]);
  11.                         $row_count = $res9->rowCount();
  12.                        
  13.                         if($row_count==0) {
  14.                         setcookie ("mail", '');
  15.                         setcookie ("password", '');
  16.                         }
  17.                         else
  18.                         {
  19.                                 $user = $res9->fetch(PDO::FETCH_LAZY);
  20.                                 $authorized = true;
  21.                         }
  22.                        
  23.                 }
  24.                 }
  25.                 ?>
  26.  
File Description
  • Проверка
  • PHP Code
  • 21 Feb-2021
  • 840 Bytes
You can Share it: