hi,
i have attempted to create a login system with php, i have the registration working to add a new user name and password into the database, thought once this is done and it send the user to login, the detials are entered and the protected page cannot be viewed, i am receiving the following message: -
Parse error: syntax error, unexpected ':' in C:\wamp\www\loon\login.php on line 8
this is the code : -
<?php
require_once "dbconfig.php"; // include the database information
$sql = mysql_query("SELECT * FROM users WHERE username='".addslashes($_POST['username'])."'") or die("username was in correct. MySQL said".mysql_error()); // this checks to see if the username exists
$result = mysql_fetch_array($sql); // puts the database information into an array
if($result[’password’] == sha1($_POST[’password’])) { // if the passwords match
session_start(); // start the session
header(”Cache-control: priavte”);
$_SESSION[”sessioname”] = $_POST['username'];
header(”Location: protected.php”);
}else{
echo “Incorrect login details please try again.”;
}
?>
is someone could help that would be greate
thanks
lukel1