Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user = 'root';
- $pass = '';
- $db = 'toDoListUsers';
- $conn = new mysqli('localhost', $user, $pass, $db)
- or die("Could not connect to Database");
- $username = $_POST['first_Name'];
- $password = $_POST['last_Name'];
- $username = stripcslashes($username);
- $password = stripcslashes($password);
- $result = mysqli_query($conn,"select * from users where username = '$username' and password = '$password'") or die("failed to query database".mysqli_error())
- $ram = mysqli_fetch_array($conn,$result);
- if($ram[username]== $username && $ram[password] == $password ){
- echo "login success!!! welcome".$ram[username];
- }else{
- echo "failed to log in";
- }
- $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement