hi,
ive got a login script that searches a database for the username and passwod. if this works then the user is redircted to another page. i would like this page to contain a piece of information from the information from the database without the user having to enter in but am having trouble getting this to work.
This is my current script:
<?php
if((!$username) or (!password))
{header("Location:$HTTP_REFERER"); exit();}
$conn=@mysql_connect("localhost","login","password")
or die("Error:Connect");
$rs=@mysql_select_db("database",$conn)
or die("Error:Database Selection");
$sql="select * from auth where username=(\"$username\") and
password=(\"$password\")";
$rs=mysql_query($sql,$conn)
or die("Error:Query");
$num=mysql_numrows($rs);
if($num !=0)
{$msg="Welcome $username";}
else
{header("Location:$HTTP_REFERER"); exit();}
?>
<html>
<body bgcolor="#c8d4E3" text="#778899" alink="#778899" vlink="#778899" link="#778899">
<h2><?php echo($msg); ?></h2>