Open Darlenequame opened 6 years ago
`<!DOCTYPE html>
i am receiving Access denied for user 'root'@'localhost' (using password: NO) how to solve it ? not inphpmy admin in login form for admin wen i type the user name and pass
`<!DOCTYPE html>
escape_string($_POST['myusername']); $mypassword = $mysqli->escape_string($_POST['mypassword']); $sql="SELECT * FROM $tbl_name WHERE email='$myusername' and password='$encrypted_mypassword'" or die(mysql_error()); $result= $mysqli->query($sql); $count=mysqli_num_rows($result); if($count==1){ // $user = $result->fetch_assoc(); // $_SESSION['admin_id'] = $user['admin_id']; if(isset($_POST['remember'])) { setcookie('$email',$_POST['myusername'], time()+30*24*60*60); // 30 days setcookie('$pass', $_POST['mypassword'],time()+30*24*60*60); // 30 days $_SESSION['curname']=$myusername; $_SESSION['curpass']=$mypassword; $user = $result->fetch_assoc(); $_SESSION['admin_id'] = $user['admin_id']; header("Location:admin.php"); exit; } else { $log1=11; $_SESSION['log1'] = $log1; $_SESSION['curname']=$myusername; $_SESSION['curpass']=$mypassword; $user = $result->fetch_assoc(); $_SESSION['admin_id'] = $user['admin_id']; header("Location:admin.php"); exit; } } else { echo ""; echo "
Wrong Username or Password
Return to login