yazo
Technical User
- Jun 9, 2004
- 3
Hello, hopefully someone can help me.
I am receiving this error on my webpage:
Notice: Undefined index: UserCookie in /var/ on line 14
And here is the getusername.php:
<?php
if (isset($_COOKIE['UserCookie']))
{
$access = $_COOKIE['UserCookie'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
elseif (isset($_SESSION['id']))
{
$access = $_SESSION['id'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
else
{
$access = $_COOKIE['UserCookie'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
$resultuser = mysql_query("$qu");
$rowuser = mysql_fetch_array( $resultuser );
$_SESSION['pp'] = $rowuser['email'];
$_SESSION['uid'] = $rowuser['userid'];
$_SESSION['gp'] = $rowuser['usergroup'];
if ($_SESSION['gp'] == 'super_maintenance')
{
$_SESSION['gp'] = 'admin';
}
$_SESSION['username'] = $rowuser['username'];
?>
Thanks, hopefully someone can shed some light on this, i cant get rid of this error.
I am receiving this error on my webpage:
Notice: Undefined index: UserCookie in /var/ on line 14
And here is the getusername.php:
<?php
if (isset($_COOKIE['UserCookie']))
{
$access = $_COOKIE['UserCookie'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
elseif (isset($_SESSION['id']))
{
$access = $_SESSION['id'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
else
{
$access = $_COOKIE['UserCookie'];
$qu = "SELECT * FROM users WHERE accesshash ='$access' LIMIT 1";
}
$resultuser = mysql_query("$qu");
$rowuser = mysql_fetch_array( $resultuser );
$_SESSION['pp'] = $rowuser['email'];
$_SESSION['uid'] = $rowuser['userid'];
$_SESSION['gp'] = $rowuser['usergroup'];
if ($_SESSION['gp'] == 'super_maintenance')
{
$_SESSION['gp'] = 'admin';
}
$_SESSION['username'] = $rowuser['username'];
?>
Thanks, hopefully someone can shed some light on this, i cant get rid of this error.