I have been working on a login system. Here is the file that is included in every page and when user fills in the login form, the form is submitted to itself, and then included file comes in action and does login work.
Here occured a proble, everything was working fine, but suddenly this error started displaying:
here is the code:
Before this when i didnt used $connection variable in the line 14 Query, the following error occured.
I havent set the username ODBC. What is this? please help me.
Thanks
Here occured a proble, everything was working fine, but suddenly this error started displaying:
| Code: |
| Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\xampp\htdocs\FRSH\php\check_login.ini on line 14 |
here is the code:
| Code: |
| <?php
if(isset($_POST['login'])) { if(isset($_POST['username']) && isset($_POST['password'])) { $username=trim($_POST['username']); $passeord=$_POST['password']; $secure_username = addslashes($username); $secure_password=md5($password); $user_query = "SELECT username FROM frsh_users WHERE username = '$secure_username'"; $user_check = mysql_query($user_query,$connection); if($user_check) { if(mysql_num_rows($user_check) == 1 ) { $password_query="SELECT password FROM frsh_users WHERE username = '$secure_username'"; if($password_check = mysql_query($password_query)) { $result=mysql_fetch_array($password_check); if(stripslashes($result['password']) == $secure_password) { $login_success=1; $_SESSION['username'] = $username; $_SESSION['password'] = $secure_password; if(isset($_POST['remember'])) { setcookie("username", $_SESSION['username'], time()+60*60*24*100, "/"); setcookie("password", $_SESSION['password'], time()+60*60*24*100, "/"); } } else $login_errors[]= "wrong password."; } } else { $login_errors[]= $username." is wrong username."; } } else $login_errors[]="Problem occured while checking database for " . $username; } } ?> |
Before this when i didnt used $connection variable in the line 14 Query, the following error occured.
| Code: |
| Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\xampp\htdocs\FRSH\php\check_login.ini on line 14
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\xampp\htdocs\FRSH\php\check_login.ini on line 14 |
I havent set the username ODBC. What is this? please help me.
Thanks
