hello there, is any way to i can see if the ip accept cookies or not ? i want to block on my website all the ips who dont accept cookies ... please help with this, thank you
The only definite way I know of to check if a user can accept cookies is to set one and then attempt to retrieve it on another page load. I don't recommend blocking the IP address of that user if they cannot accept cookies. A user's IP address may change and multiple users might have the same IP over a period of time.
Basically what you need to do is set the cookie and attempt to retrieve it on another page load.
PHP Code:
if(isset($_COOKIE['test']) && $_COOKIE['test'] == 1)
{
//cookies are enabled
}
elseif($_GET['cookieset'] == 1)
{
//cookies are not enabled
}
else
{
setcookie('test', 1, time()+3600);
header('Location: thispage.php?cookieset=1');
}
Quote:
Originally Posted by almedajohnson
Hey nullpointer
Can you share the code for the IP tracking??
Create a new thread and clarify what you are trying to do and I'd be happy to help. In the future, even if your problem is related to someone else's it is best just to create a separate thread.
T A user's IP address may change and multiple users might have the same IP over a period of time.
And search engine crawlers do not accept cookies.
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
« Reply to how i can see ips who dont accept cookies