...

View Full Version : Isnt displaying ID



Kev0121
03-26-2009, 12:09 AM
Well its not displaying the id in the address bar heres my php



db = mysql_connect($dbHost,$dbUser,$dbPass); // Connection Code
mysql_select_db($dbname,$db); // Connects to database

if(isset($_POST['submit']))
{
$username = $_POST['username'];
$password = $_POST['password'];

$sql = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
$que = mysql_query($sql);

if(mysql_num_rows($que) == 1)
{
$sql2 = "SELECT * FROM `users` WHERE `id` = '$username' ";
$qry = mysql_query($sql2) or die(mysql_error());
$post = mysql_fetch_array($qry);

$sql1 = "UPDATE `users` SET active='1' WHERE ID ='".$post['id']."' ";
$ins = mysql_query($sql1) or die(mysql_error());


$_SESSION['username'] = $_POST['username'];
header("Location: profile.php?id='$post[id]'");
}else
{
echo "<font color=\"red\"> Error Wrong Login Details </font>";
echo "<a href=\"login.php\">Login Page</a>";
}
}
?>

CyberPirate
03-26-2009, 12:23 AM
Change

header("Location: profile.php?id='$post[id]'");

To

header("Location: profile.php?id=$post['id']");

Or

header('Location: profile.php?id='.$post['id'].'');

Kev0121
03-26-2009, 12:32 AM
Cheers mate works hehe



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum