Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts

    waht is Response.Redirect ("from") for?

    Can anyone explain what the purpose of the green code and how it works?

    if Strcomp(Request.Form("User"),Username,1)=0 AND Request.Form("password") = Password then
    'Set the validation cookie and redirect the user to the original page.

    Response.Cookies("ValidUser") = Validated
    'Check where the users are coming from within the application.
    If (Request.QueryString("from")<>"") then

    else
    'If the first page that the user accessed is the Logon page,
    'direct them to the default page.
    Response.Redirect "MyPage.asp"
    End if



    Else


  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    What is that smiley supposed to be???

    Anyway, read the comment:

    If there is a "from" value in the querystring, then that's where the user will be redirect back to.

    If there isn't, then the user is sent to "MyPage.asp".

    Well, that's what would happen if the line with the smiley is replaced with
    Code:
         Response.Redirect Request("form")
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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