Hey,
Here is the following code I am using for a script that will log a user into the system. I am getting an Unexpected $ error and I can't find it anywere. Oh, and its on line 56 ... which is the last line.
<?php
include ("header.php");
$ip = getenv("REMOTE_ADDR");
$sql = "SELECT * FROM $users WHERE username = '$username' AND password = password('$password')";
$query = mysql_query($sql, $conn);
if(mysql_num_rows($query) == 0) {
error_msg("Your username / password is incorrect! Please try again!");
} else {
$info = $mysql_fetch_assoc($query);
$email = $info["emailaddr"];
$lastlogin = "UPDATE $users SET lastip = '$ip', lastlogin = '$dateandtime' WHERE username = '$username'";
$doit = mysql_query($lastlogin);
$_SESSION["useremail"] = $email;
$_SESSION["usersname"] = $username;
$_SESSION["userstatus"] = "Member";
echo "<meta http-equiv=\"refresh\" content=\"2;url=$scripts/main.php\">";
?>
<html>
<head>
<title><?php echo "$title"; ?></title>
</head>
<body bgcolor="#666666">
<div align="center">
<center>
<p> </p>
<p> </p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="405" height="124" id="AutoNumber1">
<tr>
<td width="405" height="1" bgcolor="#FFFFFF">
<img border="0" src="<?php echo "$scripts/images/logo.gif"; ?>" width="234" height="66"></td>
</tr>
<tr>
<td width="405" height="19" bordercolor="#CCCCCC" bgcolor="#CCCCCC">
<p align="center"><font face="Verdana" size="2">Thank You</font><p align="center">
<font face="Verdana" size="2">Please wait while we verify your login...</font><p align="center"><font face="Verdana" size="1">Powered By:
phpTroubleTickets 4.0</font></td>
</tr>
</table>
</center>
</div>
</body>
</html>