...

View Full Version : Parse Error on line that doesnt exsist



Seldon
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?


<?php
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");
else{
?>


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



<?php

$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;
do{
// 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
$line++;
} while($line < $totalLines);

// Include the file or send them back
if($match){
$_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']);

?>

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



<?php
}
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!


Sheldon

delinear
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");
else{

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

Nightfire
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");
else{



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum