Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/reece.awardspace.co.uk/login.php on line 49
Warning: Cannot modify header information - headers already sent by (output started at /home/www/reece.awardspace.co.uk/login.php:49) in /home/www/reece.awardspace.co.uk/login.php on line 54
i have tryed to make it get the url from the database and the link
so it gets 'priv' from database so when continue is **** it will get priv for that user eg.admin.php
Code: Select all
// hand over the request
$results = mysql_query($request);
// if mysql returns any number of rows great than 0 then there is a succesful login
if(mysql_num_rows($results))
{
// get information on user
$mysql_user = mysql_real_escape_string($user);
$query= "SELECT `user`, `priv` FROM `$dbtable` WHERE username='$mysql_user' LIMIT 1";
$rs = mysql_query($query);
$result = mysql_fetch_array($rs);
$userid = $result['userid'];
$priv = $result['priv'];
$html_user = htmlentities($user);
setcookie('userid', $userid, time() + 3600, '/', '', 0);
echo "You have successfuly loged in! Welcome, $html_user .
<a href=\"$priv\">Continue...</a>";
}
thanks in advance
reece