Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Location
    Auckland, New Zealand
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh Parse Error on line that doesnt exsist

    hi using this code i am getting a parse error on line 79. yes there are only 77 line in this code?

    PHP 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], 02)){
                    
    // 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) ? 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

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    PHP Code:
    if(@$_SESSION['user']) header("location: login.php"); 
    else{ 
    Probably needs closing just before or just after the include('library/bottom.php') line?

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •