ASP Page to cycle re-directs

P

Paul

Hi,
I have a database (MSAccess 97) that contains all the links on my website,
and I want to create an "I feel lucky" page similar to what Google does.

The links that are to be included are in a table as follows

LINK_ID | LINK_PATH | CURRENT_Y/N | NEXT_LINK

1 | http://www....| Y | 2

(I hope that makes sense in your newsreader)

The idea is that my visitors will open a page (feeling_lucky.asp) and it
will take them to which ever record is current, and then change the current
record so in the example above it would re-direct to the path but firstly
change LINK_ID 1's CURRENT_Y/N field to a "N", and then update LINK_ID 2's
CURRENT_Y/N field to a "Y" ready for the next visitor.

I have tried to do this but I'm not sure if I'm going about it the wrong
way, so I thought I'd ask for your advice.


My questions are:

Is there a better way of doing this ? ( I don't want the visits to be
random, each link must get equal traffic)

Can it all be done in 1 ASP page, or will it need several ( 1 to get the
LINK_PATH and NEXT_LINK and pass them as a URL parameter, then 1 to update
the current record, then 1 to update the next record )?


I'd be grateful of any advice, or examples you can offer.

The project has 2 purposes, "I feel lucky" and then to monitor which
products are the best to display in our Offers area, so each visitor gets a
different page of offers, then I can see which products are genuinely good
sellers,and which are pants items nobody wants to buy.

Thanks for your help

Paul
 
P

Paul

OK,
I managed to do this, so for anyone who's interested, heres what I did.

I have 1 page that stores the LINK_PATH and NEXT_LINK values in variables,
then updates all CURRENT_Y/N fields to "N", then updates the record where
LINK_ID ,matches my stored variable for NEXT_LINK so its CURRENT_Y/N value =
"Y".

In the event that the page is loaded and EOF is true, then it redirects to a
Reset page, that updates all CURRENT_Y/N fields to "N" and updates my
homepage to a "Y", then the reset page redirects back to the page mentioned
in the above paragraph.

If anyone knows a better way, i'd be happy to learn from you.

I now have a new question, having built this, I use the following in a line
of code:

Response.redirect("Http://localhost/OUTBOUND.asp?DESTINATION=" &
(My_Query.Fields.Item("LINK_PATH").Value))


How do I automatically change the domain from Http://localhost/ so I can use
the same pages in multiple different domains without having to change the
code manually?

I only have to do 2, so its not really a problem but I just wanted to learn
how to do it.

Thanks

Paul
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top