|
|
 |
ASP Question - Simple I hope.
date posted 16th January 2002 18:28
Evening all, and happy new year to all that remember me. Hope you a good
one!
Something's been really annoying me for a few hours and I thought I'd see if
any of you people could help me.
I have a small, very simple, script on an ASP page that gets the referrer
URL and if that referrer is a specified search engine displays which one on
the web page. I also need to extract a little information from the referring
url about what keywords were used to find the site.
Since all search engines have the keywords in their querystrings, which in
turn are part of the referring url I need a method of taking them out and
displaying them.
I hope everyone is following.......here's an example.
1. Somebody searches for 'dustnet york' on yahoo....
2. they are taken to this page:
http://google.yahoo.com/bin/query?p=dustnet+york&hc=0&hs=0
3. The person click the link to http://www.york.dustnet.co.uk and are taken
there
4. The script gets the URL referrer
(http://google.yahoo.com/bin/query?p=dustnet+york&hc=0&hs=0, as above)
5. It then recognises the url from yahoo, and sets a variable SearchEngine =
Yahoo
6. Now this is what I can't do.....It then extracts the keywords from p= and
sets them as a variable KeyWords = "dustnet+york"
If the original search engine were google, it would have a referring url of
http://www.google.com/search?hl=en&q=dustnet+york and would extract the q=
Basically. How do I go from a string to just the p=, q= (o s=, query= for
other search engines)
Cheers,
Jon
|
 |
|