Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conn = new PDO("mysql:host=$servername:3307;dbname=$dbname", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION, PDO::ERRMODE_SILENT);
- //gets the userid/usergroup from the users table
- $sql = "SELECT Usergroup, user_ID FROM users WHERE Username = :username";
- $sth = $conn->prepare($sql);
- $sth->bindParam(':username', $testname, PDO::PARAM_STR);
- $sth->execute();
- $row = $sth->fetch();
- //a table with all the failed logins is set to 0 if it exists for the username
- $sql = "UPDATE failed_logins SET attempted = 0 WHERE username = :username";
- $sth = $conn->prepare($sql);
- $sth->bindParam(':username', $testname, PDO::PARAM_STR);
- $sth->execute();
- //set the username/group/userid
- $_SESSION['crecketgaming_usergroup'] = $row['Usergroup'];
- $_SESSION['crecketgaming_username'] = $testname;
- $_SESSION['crecketgaming_userid'] = $row['user_ID'];
- include('sessiontest.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement