Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST)
- {
- $username = mysqli_real_escape_string(stripslashes(htmlspecialchars($_POST["username"])));
- $password = mysqli_real_escape_string(stripslashes(htmlspecialchars(sha1($_POST["password"]))));
- $q = "SELECT * FROM user WHERE username = '$username' AND password = '$password' ";
- $r = mysqli_query($dbc, $q);
- if (mysqli_num_rows($r)==1)
- {
- $_SESSION['user_name'] = $_POST['username'];
- header('location:reg1.php');
- }
- else
- {
- echo 'error again!'.mysqli_error($dbc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement