Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm trying to figure out why google adsense doesn't modify the session data, even though it asks my site after every load
Let me explain it in more detail:
Lets say I have a page called 1.php, and in this page, I add the following code:Code: Select all
$ip_stats = $_SERVER['REMOTE_ADDR'];
$sql = 'INSERT INTO stats (ip_stats,) ';
$sql .= "VALUES ('$ip_stats')";
$result = mysql_query($sql);66.249.70.198
66.249.70.198
xxx.xxx.5.67
The first 2 ip's are known google ip's, whereas the third one is mine (or eventually the client's asking ip). This pattern repeats itself over and over
BUT, if I add this code:
Code: Select all
if (isset($_SESSION['ip_has_visited'])){
$_SESSION['ip_has_visited']++;
}else{
$_SESSION['ip_has_visited'] = 1;
}
if ($_SESSION['ip_has_visited']>20){
$ip_stats = 'This ip has visited my site '.$_SESSION['ip_has_visited'].' times: '.$ip_stats;
$sql = 'INSERT INTO stats (ip_stats,) ';
$sql .= "VALUES ('$ip_stats')";
$result = mysql_query($sql);
}Anyone can tell me what's happening?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]