Liam Macmillan
New member
Hello, when I am trying to display somebodies name when they log in on my site this error occurs:
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /hsphere/local/home/c317604/youropenlife.com/index.php on line 87
This is my code:
<?php
if (isset($_REQUEST['attempt']))
{
$link = mysql_connect('mysql500.ixwebhosting.com', 'C317604_admin', 'Admin101') or die('Cant connect to database');
mysql_select_db('C317604_signuptest');
$user = mysql_real_escape_string($_POST['user']);
$password = sha1(mysql_real_escape_string($_POST['password']));
$query = mysql_query("
SELECT user
FROM users
WHERE user = '$user'
AND password = '$password'
") or die(mysql_error());
$total = mysql_num_rows($query);
if ($total > 0)
{
session_start();
$_SESSION['user'] = '$user';
header('location: junk.php');
}
if ($user==$dbuser&&$password==$dbpassword)
{
echo "You're in!"
$_SESSION['user']=$user;
}
else
{
die('Incorrect username or password!<br /> <span class="Cagain"><a href="http://www.youropenlife.com/index.php">Click here to try again</a></span>');
}
}
?>
Does any body see a problem with this?
Many thanks, Liam
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /hsphere/local/home/c317604/youropenlife.com/index.php on line 87
This is my code:
<?php
if (isset($_REQUEST['attempt']))
{
$link = mysql_connect('mysql500.ixwebhosting.com', 'C317604_admin', 'Admin101') or die('Cant connect to database');
mysql_select_db('C317604_signuptest');
$user = mysql_real_escape_string($_POST['user']);
$password = sha1(mysql_real_escape_string($_POST['password']));
$query = mysql_query("
SELECT user
FROM users
WHERE user = '$user'
AND password = '$password'
") or die(mysql_error());
$total = mysql_num_rows($query);
if ($total > 0)
{
session_start();
$_SESSION['user'] = '$user';
header('location: junk.php');
}
if ($user==$dbuser&&$password==$dbpassword)
{
echo "You're in!"
$_SESSION['user']=$user;
}
else
{
die('Incorrect username or password!<br /> <span class="Cagain"><a href="http://www.youropenlife.com/index.php">Click here to try again</a></span>');
}
}
?>
Does any body see a problem with this?
Many thanks, Liam