This is a discussion on "search queries save in a log file" within the Other Programming Languages section. This forum, and the thread "search queries save in a log file are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
search queries save in a log file
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
search queries save in a log file
I need to have a log file or database that records what people are searching for from various forms on our site. So when they search for something, they get to a results page and the database or log file gets written to so I can check to see what the most popular search parameters are.
The server technology I am using is jsp. thanks D@VE |
|
|
|
|||
|
Re: search queries save in a log file
request.getheader("Referer") will give you the referer header (i.e. the URL of the page that was searched for) within a JSP or Servlet. For arrivals from Google, and most other search engines, that will include the search terms. But note that the browser user can turn this off so that you can't be certain.
You say that you want to log this information for several pages / forms so it might be better to use your we server's log files instead. If you're running an Apache httpd (say to front an Apache Tomcat) then you should select the "Combined" log file format in httpd.conf which is commented out by default. With a Tomcat server (up to 5.0) this uses a similar mechanism but it has changed from 5,5 - you would need to download log4j from commons and configure it. There are tools available to analyse common and (in your case) combined log file formats - I use analog, others use awstats - that will give you the reports you need. From analog - complete search term reports reqs: search term -----: ----------- 1417: mysql left join 853: perl ftp 796: ip lookup 513: java loops And search word reports reqs: search term -----: ----------- 18726: perl 17153: php 13096: mysql 10227: java |
|
|||
|
Re: search queries save in a log file
Thanks Grahame, what I am after, is tracking what users on my site are inputting into my forms. These forms submit to a third party site (we are a travel company, the forms submit to a company that provides the booking engine for us) Any thoughts on this?
cheers, Dave |
|
|||
|
Re: search queries save in a log file
If you are thinking in perl you can achieve this using some perl modules for the forum.
Regards Support Terminal |
|
||||
|
Re: search queries save in a log file
DaddyO .... You really need a custom solution written in JSP.... I would do some research regarding text file creation / editing using JSP as essentially all you need to do is append a search query to a file each time a search is performed.
Hope this helps.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Re: search queries save in a log file
Thanks Rob,
I have just bought a few JSP recipe type books and hopefully I will find what I need in there. I am also salated to take a java prgramming course so maybe the teacher or someone there can guide me further. regards Dave |
![]() |
| Tags |
| search, queries, save, log, file |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL queries | alexgeek | Databases | 2 | Sep 27th, 2007 08:41 |
| search file content?? | alkingg | JavaScript Forum | 2 | Jun 11th, 2007 13:25 |
| try to open php and asks if i want to open or save file | steven rowlands | PHP Forum | 6 | Feb 20th, 2007 21:42 |
| Hyperlink to file download opens instead of save option | mickyd | Web Page Design | 2 | Sep 2nd, 2005 20:31 |
| search a text FILE BY FIRST CHAR OF WORD | gurbaksh | Flash & Multimedia Forum | 5 | Aug 22nd, 2003 15:51 |