tags:

views:

47

answers:

3

PHP NEWB. Can't figure out why I am getting this error via line 5. Any help would be greatly appreciated.

<?php
session_start();

//check to see if the user has logged in with a valid password
if ($_SESSION['authuser'] !=1 {
    echo "Sorry brah, but you don't have permission to view this page, you jerk!";
    exit();
    }
?>




<html>
<head>
<title>Movie - <?php echo $_REQUEST['favmovie']; ?></title>
</head>

<body>

<?php

    echo "Welcome to the site ";
    echo $_SESSION['username'];
    echo "! <br>";
    echo "My favorite movie is ";
    echo $_REQUEST['favmovie'];
    echo "<br>";
    $movierate = 5;
    echo "My rating of this movie is a: ";
    echo $movierate;



?>





</body>
</html>

http://cheapramen.com/phpstuff/movie.php?favmovie=Life+of+Brian

Also can't figure out why my code looks like that when I copy and paste it.

+8  A: 
if ($_SESSION['authuser'] !=1 {

You're missing a closing parentheses. Fixed version:

if ($_SESSION['authuser'] !=1) {
Amber
uuugghhh, I guess I jumped the gun, Thanks Guys!
Davey
+1  A: 

You are missing ")" on the if.

Dark Falcon
+2  A: 

You didn't close your if() statement with a parenthesis...

line 5 should read:

if ($_SESSION['authuser'] !=1) {

and not:

if ($_SESSION['authuser'] !=1 {
BraedenP