/    Sign up×
Community /Pin to ProfileBookmark

can someone help me with a pageviews counter php & mysql please?

can someone help me I have a little problem so…my problem is :
I created a page views counter but I do not know how to limit based on ip,because when i refresh the page the page view grows . my db table look like this:

<!—This is pageviews table–called (pagine)-!>
| id |
| pageid |
| pagename |
| views |
| ip |

and here is my code :->

<?php

if (isset($_GET[“id”])) {
$id = $_
GET[“id”];
}
mysql_select_db($database_filminitaliano, $filminitaliano);

$query_lista_pagine = sprintf(“UPDATE pagine SET views = views+1 WHERE pagine.pageid = %s” , GetSQLValueString($id, “int”) );
$lista_pagine = mysql_query($query_lista_pagine, $filminitaliano) or die(mysql_error());
$query_Lista_pagine = sprintf(“SELECT * FROM pagine WHERE pagine.pageid = %s ” , GetSQLValueString($id, “int”));
$lista_pagine = mysql_query($query_Lista_pagine, $filminitaliano) or die(mysql_error());
$Row_Lista_pagine = mysql_fetch_assoc($lista_pagine);
$TotalRows_Lista_pagine = mysql_num_rows($lista_pagine);
//finiamto!
?>

Can sombody give me a hand please tnks

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Atlas_Alexis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...