How can ASP send a user to a random url?

Results 1 to 2 of 2

Thread: How can ASP send a user to a random url?

  1. #1
    Chris Cotterill Guest

    Default How can ASP send a user to a random url?

    I&#039d like to create link so that users could click a link to go to a random url.<BR><BR>If possible, I would like the file called up only to be from a specific folder/director on our website, like our issues folder.<BR><BR>If it&#039s possible to limit the file chosen by a certain meta tag that all the articles (in that specific folder) have, that would be awesome. (Restricting files by filename contents won&#039t work for me here.)<BR><BR>Please Help. Thanks,<BR>Chris Cotterill

  2. #2
    sandor Guest

    Default RE: How can ASP send a user to a random url?

    Ummm, I am not sure about the metatag idea, I know you could do it this way.....<BR><BR>have your nifty link &#060;a href&#062;ultrarandomizer.asp&#060;/a&#062;<BR><BR>then have the asp page ultrarandomizer.asp<BR>&#060;%<BR>Response.Buffer = true<BR>Dim link(1), num<BR>Randomize<BR><BR>link(1) = "http://www.ubercool.com"<BR><BR>randomnumber = int(rnd * 1) + 1<BR>Response.Redirect link(randomnumber)<BR>%&#062;<BR><BR>Of course you&#039ll want to replace the 1 in the dim and randomnumber lines with however many links you acutally have and add more links with incrementing numbers instead of just the one.....<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •