Best way to do this... (SQL / ASP)

G

Graham Mattingley

Hello Group,

I run a small search engine, that has about 5000 links. The links are in the
format of http://www.sitename.xx.xx/folder.

I have a script that run so that when the link is clicked, this runs a small
script to update the SQL "link hit counter" for that link.

What I want to be able to do is display another hit counter in the page, and
this hit counter should get more hits, as sometimes the pages are hit from
other search engines.

I want to write a small include script on the page that will update the SQL
page counter. The issue I want to make this script as small as possible and
I dont know the best way to make it work..

If I use the filesystem object to return the URL is includes the page name
for example http://www.sitename.xx.xx/folder/index.asp. and this URL is not
know in my database select as the /index.asp is extra.

If I trim this which I can do to make the correct URL is this going to be a
big load bearing in mind each page get about 10,000 hits a day..... I did
also try and do a select on LIKE
"%http://www.sitename.xx.xx/folder/index.asp%" but this is not know in any
SQL row..

or am I gone completley up the wrong track and is there an easier way..

I just need to be able to find a field called
http://www.sitename.xx.xx/folder when the only URL value I have is
http://www.sitename.xx.xx/folder/index.asp..

I did consider putting a small TXT file in each folder with the UNIQUE_KEY
value for the URL, but really I want this to be able to run without any need
for other file objects.. I am just worried with more than 10,000 hits per
day, that I would like the script and query to be a fast a possible..

Kind Regards

Graham Mattingley
 
E

Evertjan.

Graham Mattingley wrote on 17 jan 2004 in
microsoft.public.inetserver.asp.general:
If I trim this which I can do to make the correct URL is this going to
be a big load bearing in mind each page get about 10,000 hits a
day.....

Less than two hits per minute:

if len(url)>0 then url = left(url,instrrev(url,"/")-1)

should be possible.
 
G

Graham Mattingley

Thanks a lot Evertjan


I never saw this ASP command before "instrrev" but it works just how I want
it toooooooooooooooo :)

Thankyou for you assistance


Graham Mattingley
 
E

Evertjan.

Graham Mattingley wrote on 18 jan 2004 in
microsoft.public.inetserver.asp.general:
I never saw this ASP command before "instrrev" but it works just how I
want it toooooooooooooooo :)

Please, it is NOT an ASP command, it is a regular VBscript command. You can
use this on clientside IE, in cScript, in wScript, in VB, in VBA too.

in ASP you can just as easily use another language for your purpose:

jScript:

url=url.replace(/\/[^\/]*$/,'')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top