My problem is that even though you enter the right credentials it says that they're incorrect. Thanks.PHP Code:<?php
session_start();
include ("global.php");
$d = mysql_query("SELECT * FROM `users` WHERE `username` = '$username' AND password = '$password'");
$data = mysql_fetch_array($d);
if($ologged == "1"){
header("Location: index.php");
} else {
if($_GET['action'] == login){
$user = $_POST['username'];
$user = htmlspecialchars($user);
$password = $_POST['password'];
$password = htmlspecialchars($password);
$password = md5($password);
if($user == $data['username'] || $password == $data['password']){
if($data['activated'] == "no"){
echo "Sorry but you have not activated your account yet. Please activate it by going to your inbox or if you have not received the email you can <a href=\"login.php?action=resendemail\">resend it.</a>";
} else {
$_SESSION['user'] = $user;
$_SESSION['loggedin'] = 1;
header("Location: index.php");
}
} else {
echo "Your login credentials are incorrect.";
}
}
}
?>
<form action="?action=login" method="POST">
<input type="text" name="username" value="Username" />
<input type="password" name="password" value="password" />
<input type="submit" value="login" />
</form>





Reply With Quote


