I've been racking my little brain on this one. I know that a parse error is generally a sytnax error (missed ; or ") but i can't find the problem.
Here is my code
Quote:
quote: <?php
session_start();
$_SESSION['username'] =$_POST['user'];
$_SESSION['userpass'] =$_POST['pass'];
$_SESSION['authuser'] = 0;
//Check username and password information
if (($_SESSION['username'] =='Joe') and
($_SESSION['userpass'] =='12345')) {
$_SESSION['authuser'] =1;
} else {
echo "Sorry , but you don't have permission to view this page!";
exit();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Find my Favourite Movie!</title>
</head>
<body>
<?php
$myfavmovie = urlencode('Life of Brian');
echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
echo "Click here to see information about my favourite movie!";
echo "</a>";
?>
</body>
</html>
|
which is giving me the following error
Quote:
|
quote:Parse error: parse error, unexpected $ in /home/../php/ch2/movie1.php on line 31
|
Line 31 is /html so the error is before this.
Could somebody look at it and tell me where i've gone wrong.
Thanks