Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-07-2006, 06:24 PM   PM User | #1
Diod
New Coder

 
Join Date: Dec 2005
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Diod is an unknown quantity at this point
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
   
}
}
?>
Diod is offline   Reply With Quote
Old 01-07-2006, 06:35 PM   PM User | #2
Kid Charming
Regular Coder

 
Join Date: Jun 2005
Posts: 804
Thanks: 0
Thanked 0 Times in 0 Posts
Kid Charming is an unknown quantity at this point
You have two opening brackets in your confirmUser() definition.
Kid Charming is offline   Reply With Quote
Old 01-07-2006, 06:50 PM   PM User | #3
Diod
New Coder

 
Join Date: Dec 2005
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Diod is an unknown quantity at this point
Ohh thx very much, that must be one of my most stupid errors ever
Diod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:19 AM.


Advertisement
Log in to turn off these ads.