Help please

Can anyone please explain to me (as simply as possible) the error in he following script:

[php]<?php
if (!(isset($_SESSION[‘loggedin’]) && $_SESSION[‘loggedin’] != ‘’))
{mysql_connect(“localhost”,“jackhinkley”,“jh9781”);
mysql_select_db("_myvid");

if(isset($_POST[‘submit’]))
{
$name = mysql_real_escape_string($_POST[‘username’]);
$pass = mysql_real_escape_string($_POST[‘password’]);
$mysql = mysql_query(“SELECT * FROM users WHERE name = ‘{$name}’ AND password = ‘{$pass}’”);
if(mysql_num_rows($mysql) < 1)
{
die(“Invalid username of password”);
}
$_SESSION[‘loggedin’] = “YES”;
$_SESSION[‘name’] = $name;
}
echo "
Username:



Password:



";} else {echo "Hello, {$_SESSION['name']}";} ?>[/php]

session_start() is above tag, this is all in body, if it affects it

What error?

The script isn’t logging in one button is pressed, and I have no idea why. Thanks in advance

Sponsor our Newsletter | Privacy Policy | Terms of Service