Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP Error


What_A_Legend's Avatar
...Legend?
0 0

Any one able to point out problem with this:

session_start();
//checks to see if user is logged in
if ($_SESSION['authuser'] !=1){
	echo "Sorry, But you don't have permission to view this page, you hacker!";
	exit()
}
?>

<html>
<head>
<title>My Movie Site - <?php echo $_REQUEST['favmovie']; ?></title>
</head>
<body>
<?php
  echo "Welcome to our site"
  echo $_SESSION['username'];
  echo "! <br>";	
  echo "My favorite movie is ";
  echo $_REQUEST['favmovie'];
  echo "<br>";
  $movierate = 5;
  echo "My movie rating for this movie is: ";
  echo $movierate;
?>
</body>
</html>
		
	```


It gives me the error

> Parse error: parse error, unexpected '}' in C:\Program Files\xampp\htdocs\moviesite.php on line 7

Uber0n's Avatar
Member
0 0

Maybe you should change

exit()

into

exit();

What_A_Legend's Avatar
...Legend?
0 0

Yep problem solved cheers cant believe i overlooked that. *Feels Silly * Cheers !


ghost's Avatar
0 0

Haha! Common mistake, happens all the time. :p


ghost's Avatar
0 0

If that isn't for testing purposes… what is the point in that script?


What_A_Legend's Avatar
...Legend?
0 0

it is testing just trying to get a good grip on PHP never had a really good deep understanding of it.