12 - 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 12.php
- <?php
- header("Content-type: text/html;charset=utf-8");
- if (sizeof($_POST)!=0){
- $link = mysqli_connect("localhost", "megaapp_user", "megaapp_app_user_pwd", "megaapp");
- if (!$link) {
- echo "ERROR: " . mysqli_connect_error() . mysqli_connect_errno() . "<br>";
- exit;
- }
- $ul = mysqli_real_escape_string ($link, $_POST['ul']);
- $up = sha1($_POST['up']);
- $r = mysqli_query($link, "SELECT * from `users` where `user_login`='$ul' AND `user_password`='$up' limit 1");
- if (mysqli_num_rows($r)==1) {
- echo 'OK';
- } else {
- echo 'ERROR';
- }
- mysqli_close($link);
- } else {
- $form = file_get_contents('form.tpl');
- $form = str_replace('{PAGE_URL}', $_SERVER['PHP_SELF'], $form);
- echo $form;
- }
- ?>
File Description
- 12
- PHP Code
- 08 Oct-2021
- 705 Bytes
You can Share it:
Latest PHP Pastes