View Full Version : Parse Error on line that doesnt exsist

06-05-2005, 11:59 AM
hi using this code i am getting a parse error on line 79. yes there are only 77 line in this code?

session_start(); // Maintain session state
header("Cache-control: private"); // Fixes IE6's back button problem.

// Are we logged in, or logging in?
if(@$_SESSION['user']) header("location: login.php");

<?php include ('library/top.php'); ?>
<?php $page="ForgotPass"; ?>


$Nemail = $_POST['Nemail'];

// Include the flat-file
$file = file("users.php") or die("Problem getting the user details flat-file [users.php]");

// Get the size of file
$totalLines = sizeof($file);

// Get the users details line by line
$line = 0;
$match = 0;
// Check the line isn't a comment
if("//" != substr($file[$line], 0, 2)){
// Break our records up
@list($username, $password, $permission, $email, $url, $dob, $location, $joined) = explode("<del>", $file[$line]);

// Check the username and passwords match
$match = ($Nemail == $email) ? 1 : 0;

// Exit loop if match found
if($match) break;

// Increment line count
} while($line < $totalLines);

// Include the file or send them back
$_SESSION["user"] = $user;
$_SESSION["pass"] = $pass;
$_SESSION["permission"] = $permission;
$_SESSION["email"] = $email;
$_SESSION["url"] = $url;
$_SESSION["dob"] = $dob;
$_SESSION["location"] = $location;
$_SESSION["joined"] = $joined;

// Refresh page
header("location: ". $_SERVER['PHP_SELF']);


<?php print $_SESSION['email']; ?>
<?php print $_SESSION['pass']; ?>

else header("location: clients.php?fail=1");

<?php include ('library/bottom.php'); ?>

If anyone has any idesa please tell me am i missing an endif or else or } or something?

Thanks Alot!


06-05-2005, 12:53 PM
You're one closing bracket short, I'm guessing from the code that it's the else statement right near the top that needs closing off:

if(@$_SESSION['user']) header("location: login.php");

Probably needs closing just before or just after the include('library/bottom.php') line?

06-05-2005, 12:57 PM
TO make things 100% easier for yourself, use the curly brackets all the time. Sometimes you're using them and sometimes you're not and that's when you end up missing ones off that should be there.

Add another curly bracket, a closing one, for wherever you need to close this off

if(@$_SESSION['user']) header("location: login.php");