rse error: syntax error, unexpected T_STRING
Posted: Thu Dec 28, 2006 10:36 am
I can't find the error!
Parse error: syntax error, unexpected T_STRING in /home/rwphoto/public_html/loginclass.php on line 59
Help!
Parse error: syntax error, unexpected T_STRING in /home/rwphoto/public_html/loginclass.php on line 59
Help!
Code: Select all
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);
Class Mysql {
var $link;
var $database;
function Mysql($db,$dbuser,$dbpass) {
$this->link = mysql_connect('localhost', $dbuser, $dbpass) or die(mysql_error());
$this->database = mysql_select_db($db);
if (!$this->database) {
die('COULD NOT CONNECT: ' . mysql_error());
}
}
}
class Auth {
var $quesr;
var $qpass;
var $query;
var $rows;
var $result;
var $location;
function login($user,$pass) {
$this->quser = $user;
$this->qpass = $pass;
$this->query = sprintf("SELECT * FROM users WHERE username='%s' AND password='%s'",
mysql_real_escape_string($this->quser), mysql_real_escape_string($this->qpass));
$this->result = mysql_query($this->query);
$this->rows = mysql_numrows($this->result);
if (!$this->result) {
die('QUERY FAILED: ' . mysql_error());
}
if ($this->rows != 1) {
$_SESSION['errmsg'] = "No match found";
// Set location to login script because failed login.
session_write_close();
header('Location: http://rwphoto.thepeopleshost.com/login.php');
exit;
} else {
$_SESSION['auth'] = 1;
$_SESSION['authx'] = (time() + 900);
// Set Fowarded location if login passes
session_write_close();
header('Location: http://rwphoto.thepeopleshost.com/members.php');
exit;
}
}
function checkLogin() {
if ($_SESSION['auth'] != 1) {
$_SESSION['errmsg'] = 'Authentication required to view the requested page';
session_write_close();
header('Location: http://www.rwphoto.thepeopleshost.com/login.php');
exit;
} // line 59
if (1 == 2) {
$_SESSION['errmsg'] = 'You're login has timed-out, please login again.';
session_write_close();
header('Location: http://www.rwphoto.thepeopleshost.com/login.php');
exit;
}
$_SESSION['authx'] = (time() + 900);
}
function logout() {
session_destroy();
}
}
?>