dvayne Posted April 19, 2008 Share Posted April 19, 2008 how to check if this url http://www.domain.com/file.php?id=1 , http://www.domain.com/file.php?id=2... is already visited once?? please help me.. thanks.. Link to comment https://forums.phpfreaks.com/topic/101816-checking-values-of-database-if-its-already-viewed/ Share on other sites More sharing options...
stuffradio Posted April 19, 2008 Share Posted April 19, 2008 You could simply insert the value in to a table called view or something... the view table would contain the view_number. $number = $_GET['p']; if (!is_numeric($number)) { echo "Not a valid number!"; exit; } $check = mysql_query("SELECT view_number FROM `table` WHERE `view_number`='$number'"); $query = mysql_num_rows($check); if ($query > 0) { echo "This page has already been viewed!"; } ?> Link to comment https://forums.phpfreaks.com/topic/101816-checking-values-of-database-if-its-already-viewed/#findComment-521029 Share on other sites More sharing options...
dvayne Posted April 19, 2008 Author Share Posted April 19, 2008 You could simply insert the value in to a table called view or something... the view table would contain the view_number. $number = $_GET['p']; if (!is_numeric($number)) { echo "Not a valid number!"; exit; } $check = mysql_query("SELECT view_number FROM `table` WHERE `view_number`='$number'"); $query = mysql_num_rows($check); if ($query > 0) { echo "This page has already been viewed!"; } ?> thanks, please explain your code... i'm newbie in php Link to comment https://forums.phpfreaks.com/topic/101816-checking-values-of-database-if-its-already-viewed/#findComment-521041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.