Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Saving search strings in cookies?


Message #1 by "J. Stewart" <dsjsyndicate@y...> on Tue, 29 May 2001 02:43:14
I'm trying to figure out a way to save previous searches in to cookies and 

have it populate a drop down list. I only want to save the last 5 searches 

and have a new one "push out" the oldest search. Any ideas?
Message #2 by "Enigma" <enigma@b...> on Tue, 29 May 2001 15:18:30



Thats what I am doing



I have it so that I save the search query and searchengine what is been 

searched in a text file.



I use a dropdown box and text field to let people browse main serach 

engines so when the click " GO"  the serchquery and engine is saved in a 

cookie, (Java Script)when the person comes back they see the last personal 

search. 

]

AS well this two values are saved in a text log file. (CGI) 



you can see what I am talking about when you look at one of this log files 

your self http://www.browseabit.com/load/logs.txt



 to get your question answered now to read this values and work with it I 

just need the above text file and ASP



the formmat is :



______

text file

____



Yahoo|Hotels+Canada+Ontario

Mama|plastik surgery

google|plastik surgery

google|Reading and Writing Text Files with ASP

BB|Reading and Writing Text Files with ASP

BB|+elliott+real+estate

___



So like I said I did not do this actual code part but we can do it from 

here together if you like.....?



we need to get a line from the text file split in two values  so we get 

the first value what is the searchengine picked by the last user "|" and 

after.... the query himself.......



and if we just want to reuse the last five lines from the textfile what 

are the  actual last seraches performed on the site

______



a if statment would help us select what engine is been in question



if firstvalue = google then 

 myformnam.engine = http://www.google.com/search?safe=off&q



here you see what my droplist looks like:



____



option value="BB|http://www.browseabit.com/browse.asp?

query=">Browseabit</option>

<option value="altavista|http://service.bfast.com/bfast/click?

siteid=29943662&bfpage=search_smy&bfmid=22218516&user=befree&pg=q&kl=XX&q="

>Alta

Vista</option>

<option value="Antique|http://www.antiquesearcher.com/cgi-

bin/links/search.cgi?query=">Antique

Search</option>

<option value="Britannica|http://search.britannica.com/search?

query=">Britannica</option>

_____



Well I hope that brings you all on the right path do the your job you got 

to check it out and ask me specific question if you need more help but for 

sure let me know how you doing on yours, like I said I maybe will use it 

on my domains to the end, 

if it is a good Idea to show a user the last searches performed from the 

last guy who just left the site???

Like u can see in the log file are some search queries what Jung kids 

should not see and this could make some privercy concerns etc.... 

depending what your site is all about I guess....






  Return to Index