Dear php pro guys i need your help please;
i have 3 files; index.php login.php and member.php
my major problem i cant prevent the link to be copied after logging in
in php4 ---file:memeber.php--- if ($_SESSION["login"] !=1 -- it works great when the user log in and link can not be copied it redirect him to index.php
after migrating to php5
now in php5---file;member.php- if ($_SESSION["login"] !=1 ---- wont access the page and neither i can log in from index.php
so if i set that to if ($_SESSION["login"] !=0--- it works great
but my problem is that the link can be copied and can be accessed
in other words not good ;user can access without logging in i can not redirect; please i need your full support guys and part of my script is below ;
<?php ob_start() ?>
<?php
session_start();
// date calculation function
// adds or subtracts a date based upon the input.
// $this_date is a string format of a valid date ie.. "2006/08/11"
// $num_days is the number of days that you would like to add (positive number) or subtract (negative number)
function fnc_date_calc($this_date,$num_days){
$my_time = strtotime ($this_date); //converts date string to UNIX timestamp
$timestamp = $my_time + ($num_days * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400)
$return_date = date("Y/m/d",$timestamp); //puts the UNIX timestamp back into string format
return $return_date;//exit function and return string
}//end of function
$UID=$_SESSION["logID"];
//echo $UID;
//Check to see if the user was already logged on
if ($_SESSION["login"] !=0 && $_SESSION["login"] !=3)
{
header ('Location: index.php?Msg=3');
}
//echo $_SESSION["login"];
//Connect to DB and Get the mailing list
$dbcnx = mysql_connect('my host', 'my username', 'my pass');
//we could connect to the database
//Select the DB we want to deal with
mysql_select_db ("charbel");
?>