Your WebCode

Log In / Submit Code / Join     

Find Code
    Highest Rated
    Newest
    Most Viewed
    Browse
           ASP
           ASP.NET
           CSS
           JAVA
           JavaScript
           PERL
           PHP


Resources
  
Web Hosting Company
for Programmers

Norwich Web Design
eShop commerce software
PHP Jobs
budget web hosting
Ventrilo
bedroom furniture
Mortgages
Lawnmowers
Fridge Freezers
Christening Gifts
Digital Photo Frames


Redirect user based on a variable

 Language:  ASP Unrated
Rated by 0 Users

1 Star = Horrible
5 Stars = Perfect
Rate Code Now
 Posted By:  Blake
 Author Website:  Differences between ASP and PHP
 Posted On:  7/10/2007
 Code Views:  2607
   This short code will read in a variable and redirect the user to a certain url depending on which value the variable is set to.



<%
' Initialize variable
dim strGoTo

' Set the variable
strGoTo = "page2"

' determine which page the user should be sent to
if strGoTo = "page1" then

    ' this send the user to the page
    response.redirect("page1.html")

    ' the ends the server processing for this page
    response.end

elseif strGoTo = "page2" then

    ' this send the user to the page
    response.redirect("page2.html")

    ' the ends the server processing for this page
    response.end

end if

%>


View code in Textarea

This code has not been tested by Your WebCode.
Use it at your own risk.
Please report any copyright violations.



Reviews
Hide Reviews | Add Review | Delete Review 
No Reviews

Blog | Monthly Contest | Current Contest Leaders | FAQ | Link to us
Privacy Policy | Terms | Credits | Other Sites | Contact Us
Copyright © 2008, Your WebCode.