错误说 Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE on line 11 我以前也使用过相同的代码,它在那里工作正常
class connection{
// variables for cms login
var $admin_name1 = "name";
var $admin_passwd1 = "passwd";
// variable to recieve data from form
var rename; //********** this line is giving error
var repasswd;
function cms_login()
{
if(($this->rename == $this->admin_name1) && ($this->repasswd == $this->admin_passwd1)){ // access granted
echo 'Access granted<br>';
echo 'Please wait while you are being redirected';
session_start();
$_SESSION['piratica']="active";
$redirect = "Location: landing.php";
echo header($redirect);
}
else { // access denied
echo 'WARNING !!';
echo '<br>Wrong login details.';
}
} // function cms_login ends here
} // class connection ends here