brown2005 Posted February 29, 2008 Share Posted February 29, 2008 $hits_sql = mysql_query("SELECT * FROM statistics_hits_website WHERE hits_user='$config_ip' AND hits_user_type='0' AND hits_date='$date' AND hits_page='$page'", $connection); $hits_rows = mysql_num_rows($hits_sql); if ($hits_rows > 0) { $hits_update = "UPDATE statistics_hits_website SET hits_count= hits_count +1 WHERE hits_user='$config_ip' AND hits_user_type='0' AND hits_date='$date' AND hits_page='$page'"; mysql_query($hits_update); } else { $hits_insert = "INSERT INTO statistics_hits_website(hits_user,hits_user_type,hits_page,hits_date,hits_count) VALUES('$config_ip','0','$page','$date','1')"; mysql_query($hits_insert); } i have the following code which keeps record of hits to my website but i am getting some strange results in my table... for hits_page http://www.cjp.spb.ru/en/tis/leboma/ http://www.psikolojikyardim.org/etkinlik/include/eto/nixaz/ http://www.northfans.ch/forum/admin/settings/gucor/ujusu/ how on earth have these got in here? and how can i stop them? Link to comment https://forums.phpfreaks.com/topic/93694-strange-results-in-my-database/ Share on other sites More sharing options...
brown2005 Posted February 29, 2008 Author Share Posted February 29, 2008 if(!isset($page))$page="home"; switch($page) { case "home":$file="files/home.php"; break; } that is the code that sets the page Link to comment https://forums.phpfreaks.com/topic/93694-strange-results-in-my-database/#findComment-480076 Share on other sites More sharing options...
brown2005 Posted February 29, 2008 Author Share Posted February 29, 2008 any ideas at all please? Link to comment https://forums.phpfreaks.com/topic/93694-strange-results-in-my-database/#findComment-480350 Share on other sites More sharing options...
brown2005 Posted February 29, 2008 Author Share Posted February 29, 2008 hi i have worked out wat the problem is with the above. i have say this below to get pages.. index.php?page=home but if you change to say page=rjewngjrgjrwengjerjgnrejkg then rjewngjrgjrwengjerjgnrejkg is entered into my website. how can i make it so only a certain set of pages is entered... would it be best to create a function or a table with what is acceptable or something else? Link to comment https://forums.phpfreaks.com/topic/93694-strange-results-in-my-database/#findComment-480362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.