Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am looking for an ASP script that....

Status
Not open for further replies.

JoeM6

Programmer
Aug 5, 2000
53
US
I have seen on many sites that have tons of links that instead of links, they just use an Id number. Example. Lets say i wanted to link to Instead of the url being i want it to be Do you get what i mean? If not i can try and find a site with an example. Please reply a.s.a.p
Thanks

JoeM6
JPMJR11@aol.com
 
create a database table containing all the links to all the pages that you are linking to, then do a response.redirect.

ex:

tblLinks
id sitename
1 2 3 4
this assumes c is an open connection
dim id, goto, r
id = Request.QueryString("ID")
r.Open "SELECT sitename FROM tblLinks WHERE id = " & id, c
goto = r("sitename")
r.close
set r = nothing

Response.redirect (goto)

that's the bare bones of it all, if you want you can increment a counter before redirecting, etc.

good luck
leo
 
that's basically all you need.

you still need to set up the DB connection, though... check out faq333-178 for more info.

Something to note -
if Response.redirect doesn't work, you will need to add
Response.buffer = true

to the top of your ASP redirect page

good luck
leo
 
Ok, this isn't working for me at all. Can you make up the page for me or just tell me all the code here? If you do, I can place a link to your site in return. The database would be through Microsoft Access named links.mdb. Also, when i have the links with the id and everything, can that be on a html page or does it have to be an asp page?

JoeM6
JPMJR11@aol.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top