jQuery - Redirecting a Page

Discussion in 'jQuery' started by cancer10, Aug 1, 2008.

  1. #1
    Hi

    I am using PHP and jQuery to validate a login. If the user enters wrong user/pass, an error message will be shown on the index.php page, under a <DIV></DIV> tag. This works fine...

    But, how do I make an index.php page redirect to welcome.php once the user enters the correct login information? Since everything is handled by jQuery, hence using the header("location: welcome.php") function will not work as the page is NOT refreshing.


    Please help.


    Thanx
     
    cancer10, Aug 1, 2008 IP
  2. VishalVasani

    VishalVasani Peon

    Messages:
    560
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    for redirection you can used javascript location.href or window.url
     
    VishalVasani, Aug 1, 2008 IP
  3. M.Zeb Khan

    M.Zeb Khan Peon

    Messages:
    104
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You should make your onsubmit="return yourfunction();"

    So, when the validation is successful, return true when its not return false.

    thats it
     
    M.Zeb Khan, Aug 3, 2008 IP
  4. qprojects

    qprojects Peon

    Messages:
    1,901
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    0
    #4
    www.pageresource.com/jscript/jredir.htm
    www.tizag.com/javascriptT/javascriptredirect.php
     
    qprojects, Aug 4, 2008 IP
  5. cancer10

    cancer10 Guest

    Messages:
    364
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    k. Thanx for the reply.
     
    cancer10, Aug 16, 2008 IP