jeger003 Posted December 14, 2008 Author Share Posted December 14, 2008 for some reason it keeps collecting from my ip........i double checked my ip and its the same....i have cable.....i looked over the code many times cant find anything wrong......see it below if you can catch something <?php include 'dbconfig.php'; if(isset($_POST['b']['search_text'])) { /* change $myIP to your public IP, you can find it by going to www.whatismyip.com */ $myIP = '123.456.789.0123';//this is of course replaced with my ip if($_SERVER['REMOTE_ADDR'] != $myIP) // if remote address NOT EQUAL to $myIP then track the search term. { $cleanText = mysql_real_escape_string($_POST['b']['search_text']); mysql_query("INSERT INTO searched (text,IP,Date) VALUES ('$cleanText',\"".$_SERVER['REMOTE_ADDR']."\",NOW())"); } } as you can see i also collect the time and ips of visitors....so i know whos coming and looking for what....but im not sure if that would have any effect on it Link to comment https://forums.phpfreaks.com/topic/136308-solved-i-want-to-collect-what-my-users-are-searching-for-on-my-site-with-a-basic-form/page/2/#findComment-714892 Share on other sites More sharing options...
chronister Posted December 14, 2008 Share Posted December 14, 2008 $myIP = '123.456.789.0123'; You need to replace 123.456.7890 with your actual IP address. Hit www.whatismyip.com and the numbers that it gives you need to be what $myIP equals. Nate Link to comment https://forums.phpfreaks.com/topic/136308-solved-i-want-to-collect-what-my-users-are-searching-for-on-my-site-with-a-basic-form/page/2/#findComment-714931 Share on other sites More sharing options...
jeger003 Posted December 14, 2008 Author Share Posted December 14, 2008 oh i found the problem.........pretty embarrassing lol.......i made the changes but never ftped them.........kept refreshing the pages thinking i had it up. its working wonderfully Thank You Nate! I may need some help in the future........if you have time Link to comment https://forums.phpfreaks.com/topic/136308-solved-i-want-to-collect-what-my-users-are-searching-for-on-my-site-with-a-basic-form/page/2/#findComment-715258 Share on other sites More sharing options...
chronister Posted December 14, 2008 Share Posted December 14, 2008 One reason I like dreamweaver... it auto ftps on save. Don't like the way it codes stuff... but decent editor/ftp/change manager. its working wonderfully Thank You Nate! Your welcome.... remember to mark as solved. I may need some help in the future........if you have time No prob. Nate Link to comment https://forums.phpfreaks.com/topic/136308-solved-i-want-to-collect-what-my-users-are-searching-for-on-my-site-with-a-basic-form/page/2/#findComment-715325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.