www.webdeveloper.com
Results 1 to 2 of 2

Thread: user redirect on authentication

  1. #1
    Join Date
    Apr 2012
    Posts
    99

    user redirect on authentication

    I am trying to log in a user if they have the right login credentials.

    login.php:
    Code:
    function(data){  
            				var error = (data == 'true') ? '' : '<img src="images/red_x.png" width="24" height="24" /> Please fill in all fields.';
    
    						$('#errorLogin').html(error);
    						
    						var success = (data == true) ? 't' : 'f';
    
    						if(success=='f') {
    							// fade back in the login screen
    							$('#loginContainer').fadeIn("slow");
    							// continue anyway for now...
    							$.get
        						(
        							"loginUser.php",
        							{ 
            							username: $("#username").val(), password: $("#password").val(), rememberMe: $("#rememberMe").val(), login: ('true')
            						},
    								function(data){  
            							var fail = (data!='') ? data : 'Unknown Error... Please contact us for more details!';
    									alert(data);
    
    									$('#errorLogin').html(fail);
    								}
    							)
    						}
    then loginUser.php:
    Code:
    							memberRedirect($username, $rememberMe, $password);
    and finally, in my function.php file:
    Code:
    header( 'Location: members.php' ) ;
    so it should be redirecting. in my member redirect page, i have code that updates with the date that the user logged in. it seems ot be updating, but whenever i try to login, it never redirects me. is this since it's a function, and it HAS to return?

  2. #2
    Join Date
    Jan 2005
    Posts
    348
    Might get a better response if you post this in a server-side and/or PHP forum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles