Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // fixString.php
- require_once 'login.php';
- $connection = new mysqli($hn, $un, $pw, $db);
- if ($connection->connect_error)
- die($connection->connect_error);
- var_dump($_POST);
- $user = mysql_fix_string($connection, $_POST['user']);
- $pass = mysql_fix_string($connection, $_POST['pass']);
- $query = "SELECT * FROM customers WHERE name='$user' AND isbn='$pass'";
- $result = $connection->query($query);
- if (!$result)
- die($connection->error);
- echo $user . "<br>";
- echo $pass . "<br>";
- function mysql_fix_string($connection, $string)
- {
- if (get_magic_quotes_gpc()) // returns TRUE if magic quotes are active
- $string = stripslashes($string);
- return $connection->real_escape_string($string);
- }
- ?>
- array(0) { }
- Notice: Undefined index: user in C:xampphtdocsPHPfixString.php on line 8
- Notice: Undefined index: pass in C:xampphtdocsPHPfixString.php on line 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement