Jump to content

[SOLVED] PHP code help


pleek

Recommended Posts

ok so im learning php and ive been following the code in the book im learning bye. but im havin a problem. The script username and password protects a page. The loggin script works fine after some debugging but when it loads the password protected page i get this error

 

Parse error: parse error, unexpected T_IF in /homepages/10/d210379154/htdocs/dsc045748853/movie1.php on line 11

 

I fixed a few things that weren't the same as the book but i still get the same error. I don't know whats wrong so hopefully some one here can help me.

 

Here is the script of the page that im getting the error. I marked line 11 with a comment

 

<?php
session_start();
//gets the username and password from form
$_SESSION['username']=$_POST['user'];
$_SESSION['userpass']=$_POST['pass'];

$_SESSION['authuser']=0

//Check username and password information

//this is line 11\/ 12 without the comment
if (($_SESSION['username']== 'Pleek') AND
	($_SESSION['userpass']== 'lucky1'))
{
$_SESSION['authuser']=1
}
else
{
echo "You have not entered the correct username and password";
exit()
}
?>

<HTML>
<HEAD>
<TITLE>Movie</TITLE>
<HEAD>

<BODY>

<?php

$myfavmovie=urlencode("National Treasure");
echo "<a href="http://craigh.tlcrepair.net/movieset.php?favmovie=$myfavmovie'>"
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</BODY>
</HTML>

 

WHATS WRONG???

Link to comment
https://forums.phpfreaks.com/topic/74819-solved-php-code-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.