Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function checkLogin(){
- if (isset($_GET['page']) && ($_GET['page'] == 'signup'))
- {
- return false; //prevents the 'incorrect username/pw' message from being displayed, since both use the same 'post' variable names
- }
- else if ( isset($_POST['username']) && isset($_POST['password']))
- {
- if ( $_POST['username'] )
- $username = mysql_real_escape_string($_POST['username']);
- if ( $_POST['password'] )
- $password = mysql_real_escape_string($_POST['password']);
- $password = md5($password . 's4lt_141812');
- $q = "SELECT * FROM usertable WHERE user_name = '$username' AND user_password = '$password'";
- $r = mysql_query($q);
- if ( $r !== false && mysql_num_rows($r) > 0 )
- {
- // echo '<p>Successfully logged in</p>';
- $_SESSION['username'] = $username;
- }
- else
- echo '<p>Incorrect username / password combination</p>';
- }
- }
Add Comment
Please, Sign In to add comment