Check - 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.
Result of php executing
Full code of Check.php
- <?php
- $username = filter_var(trim($_POST['username']),
- FILTER_SANITIZE_STRING);
- $password = filter_var(trim($_POST['password']),
- FILTER_SANITIZE_STRING);
- $password = md5($password.'ghjsfkld2345');
- $mysql = new mysqli("z111349.hostru12.fornex.host", "z111349_dbuser", "5TAaupiN>j4zPH$X", "z111349_auth");
- $result = $mysql->query("SELECT * FROM `authme` WHERE `username` = '$username' AND `password` = '$password'");
- $user = $result->fetch_assoc();
- if (count($user) == 0) {
- echo 'Такой пользователь не найден';
- exit();
- }
- setcookie('user', $user['name'], time() + 3600, '/');
- $mysql->close();
- header('Location: /');
- ?>
File Description
- Check
- PHP Code
- 02 Sep-2022
- 668 Bytes
You can Share it:
Latest PHP Pastes