Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 4.25 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-01-2008, 01:58 PM   PM User | #1
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 799
Thanks: 211
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
Question jQuery - Redirecting a Page

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 is offline   Reply With Quote
Old 08-01-2008, 02:06 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Since you are using ajax for login, I think replacing the login form and other related stuffs with a welcome message would be more elegant than a redirection. Though you could execute a simple javascript snippet like
Code:
window.location="welcome.php";
PS: Make sure that you are using a progressive enhancement methodology, otherwise your site would result serious accessibility issues.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 08-01-2008, 03:22 PM   PM User | #3
cancer10
Regular Coder

 
Join Date: Jun 2006
Location: India
Posts: 799
Thanks: 211
Thanked 2 Times in 2 Posts
cancer10 can only hope to improve
How would jQuery know that the login is correct since the authentication process is handled by PHP?
cancer10 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:45 PM.


Advertisement
Log in to turn off these ads.