I have tried like 3 people’s code (well one from me, and 2 others) and they are all basically the same and they all are working fine except that when I tried to log in it won’t work, it just goes straight to the error bad login. So here is my code, see if you can find the problem:
<?php
$username = "hjkhjk";
$password = "hjkhjk";
$database = "hjkhjk";
$hostname = "hjkhjk";
//connection to the database
$handle = mysql_connect($hostname, $username, $password, $database)
or die("");
echo "";
//select a database to work with
$selected = mysql_select_db("hjkhjk",$handle)
or die("Could not select dhjkhj");
session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);
$query = “select * from users where username=’$username’ and password=’$password’”;
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
include “login.html”;
} else {
$_SESSION[‘username’] = “$username”;
include “memberspage.php”;
}
?>