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

Thread: unexpected $end

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    unexpected $end

    I'm getting "Parse error: syntax error, unexpected $end in c:\appserv\www\schuivende pol\includes\functions\login.php on line 64"
    This is login.php :

    PHP Code:
    <?
    function initiate_session($userid$name$access_lvl$origin
    {
        if (
    $origin == "admincp") {
        include(
    "../includes/config.inc.php");
        }
        else if (
    $origin == "index") {
        include(
    "includes/config.inc.php");
        }
        else
        {
        die (
    "Undefined error");
        }

    session_regenerate_id();
    $titleresultq mysql_query("SELECT * FROM " $dbprefix "_site WHERE Name='SiteTitle'");
    while (
    $titleresulta mysql_fetch_array($titleresultq)) 
          {
    $_SESSION[$titleresulta[Text]]['name'] = $name;
    $_SESSION[$titleresulta[Text]]['access_lvl'] = $access_lvl;
    $_SESSION[$titleresulta[Text]]['userid'] = $userid;
          }
    header("Location: index.php");
    }

    function 
    confirmUser($username$password$origin){
    {
        if (
    $origin == "admincp") {
        include(
    "../includes/config.inc.php");
        }
        else if (
    $origin == "index") {
        include(
    "includes/config.inc.php");
        }
        else
        {
        die (
    "Undefined error");
        }

       
    /* Add slashes if necessary (for query) */
       
    if(!get_magic_quotes_gpc()) {
        
    $username addslashes($username);
       }

       
    /* Verify that user is in database */
       
    $q "SELECT Password FROM " $dbprefix "_users WHERE Name='" $username "'";
       
    $result mysql_query($q);
       if(!
    $result || (mysql_num_rows($result) < 1)){
          return 
    1//Indicates username failure
       
    }

       
    /* Retrieve password from result, strip slashes */
       
    $dbarray mysql_fetch_array($result);
       
    $dbarray['Password']  = stripslashes($dbarray['Password']);
       
    $password stripslashes($password);

       
    /* Validate that password is correct */
       
    if(strtolower($password) == strtolower($dbarray['Password'])){
          return 
    0//Success! Username and password confirmed
       
    }
       else{
          return 
    2//Indicates password failure
       
    }
    }
    ?>

  • #2
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have two opening brackets in your confirmUser() definition.

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ohh thx very much, that must be one of my most stupid errors ever


  •  

    Posting Permissions

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