[thelist] Javascript smartypants needed

Joshua Olson joshua at waetech.com
Thu May 6 08:57:25 CDT 2004


> -----Original Message-----
> From: tony
> Sent: Wednesday, May 05, 2004 9:28 PM
>
> Hi there,
>
> Can anyone help me with the following:
> I need some javavscript or ASP code that simply allows me to redirect
> someone who visits my homepage, to a number of sequential ASP files.
> ie - when someone arrives at my homepage (default.asp) page they are
> immediately
> redirected to default1.asp.And then the next viewer that comes to my
> default.asp
> homepage - is immediately sent to default2.asp. And so on and so on.

Tony,

Something like this?

<%
  If IsNumeric(Session("hpcount")) Then
    ' Use the mod if there are only a certain number of hompages
    Session("hpcount") = (Session("hpcount") MOD 10) + 1
  Else
    Session("hpcount") = 1
  End If

  Response.Redirect "default" & Session("hpcount") & ".html"
%>

Does this help?

Perhaps a better solution would be to include a file (by loading it from
disk and then Response.Write(ing) it to the output buffer depending on the
session's count and not actually redirecting to a new page.  Look at the
FileSystemObject for help on loading a file from disk:

http://www.w3schools.com/asp/asp_ref_filesystem.asp

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list