Jump to content

[SOLVED] I want to collect what my users are searching for on my site with a basic form


jeger003

Recommended Posts

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

 

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 :)

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.