i have sell.php page which requires loggin so i put in it:
<?
session_start();
if(!(session_is_registered("valusername")))
{
$page=$PHP_SELF;
session_register("page");
header("Location:http://$HTTP_HOST/auction/login.php");
exit();
}
?>
then in login.php i have;
$sql = "SELECT * FROM registration WHERE username = '$username' and
password='$password'";
$result = mysql_query($sql,$conn);
if(@mysql_num_rows($result)> 0)
{
$row = mysql_fetch_array($result);
$valusername=$row["username"];
session_register("valusername");
mysql_close($conn);
if(session_is_registered("page"))
{
header("location:http://$HTTP_HOST/".$page);
session_unregister("page");
}
else
header("location:http://$HTTP_HOST/auction/index.php");
exit();
}
else
{
echo "<p align='center'><font face='Comic Sans MS' size='6'
color='#FF0000'>Sorry!!</font></p>
<p align='center'><font color='#000080' size='4'>You entered either a wrong username or
password.<br><a href='login.php'>try again</a></font></p>";
}
and yes it goes to sell.php page but the url is:
http://localhost//php/php.exe/auction/seller/sell.php
and i tried instead:
if(session_is_registered("page"))
{
header("location:http://$HTTP_HOST/".$$HTTP_REFERRER);
session_unregister("page");
}
but it goes to
http://localhost
anyhelp?????
Rehab M.Shouman
------------------------------------------------------------
------------------------------------------------------------
---------------------------------------------------------------------
Express yourself with a super cool email address from BigMailBox.com.
Hundreds of choices. It's free!
http://www.bigmailbox.com
---------------------------------------------------------------------
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php