...

View Full Version : unexpected $end



Diod
01-07-2006, 06:24 PM
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 :


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

Kid Charming
01-07-2006, 06:35 PM
You have two opening brackets in your confirmUser() definition.

Diod
01-07-2006, 06:50 PM
Ohh thx very much, that must be one of my most stupid errors ever :p



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum