Originally posted by smiker
Just wanted to know why my IP address changes, and some times is the same. I have a counter, didn't want to use cookies, I didn't want to count myself, because I reload main page a lot. Have if statements if($ip == "my ip address at the time"){print something}else{print hello again (ME)}
Would I be better off with cookies or sessions and if so how would I do this... im bad at cookies.
Eric
I rather go with sessions unless that on everypage you are going to do
if($_SERVER['REMOTE_ADDR'] == $IP)
but that is kinda scary i rather just compare it on the first page only then
session_start()
if($_SERVER['REMOTE_ADDR'] == $IP)
{
session_register("myip");
$myip = $ip;
//include your script
}
on the other script
session_start();
if(!session_is_registered("myip"))
{
echo "get out!!!!";
}
or you can just assigned it with $_SESSION['myip'] = $ip with ever way is better for you