Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $java = new java();
- class java {
- function popup($text)
- {
- echo '<script type="text/javascript"> alert(\''.$text.'\');</script>';
- }
- function redirect($url)
- {
- echo '<script> window.location = "'.$url.'"</script>';
- }
- }
- class profile {
- function login($username,$password)
- {
- $new_password = md5($password);
- $result=mysql_query("SELECT * FROM accounts WHERE Username='$username' AND Password='$new_password' LIMIT 1");
- if (mysql_numrows($result) == 0)
- {
- echo '<script type="text/javascript"> alert(\'Incorrect login information\');</script>';
- }
- while($user_r=mysql_fetch_array($result))
- {
- $user_username = $user_r["Username"];
- $user_password = $user_r["Password"];
- $user_class = $user_r["Title"];
- $_SESSION['status'] = 'Logged';
- $_SESSION['username'] = $user_username;
- $_SESSION['password'] = $user_password;
- $_SESSION['class'] = $user_class;
- $java->redirect("index.php"); ## Line that is non-object
- }
- }
- }
Add Comment
Please, Sign In to add comment