Results 1 to 2 of 2

Thread: Header Location error

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2004
    Posts
    1,202

    Header Location error

    Hello,

    im trying to display my echo after I register the user

    PHP Code:
    echo 'You\'ve been registered successfully!'
    it dosent seem to want to show can anyone tell me what im missing please this is the full register.php code.

    PHP Code:
    <?php 

        
    if (isset($_GET['success']) && empty($_GET['success'])) { 
            echo 
    'You\'ve been registered successfully!'
        } else { 
            if (empty(
    $_POST) === false && empty($errors) === true) { 
            
    $register_data = array( 
                
    'username'         => $_POST['username'], 
                
    'password'        => $_POST['password'], 
                
    'first_name'     => $_POST['first_name'], 
                
    'last_name'     => $_POST['last_name'], 
                
    'email'         => $_POST['email'], 
            ); 
             
            
    register_user($register_data); 
            
    header('Location: register.php?success'); 
            exit(); 
             
        } else if (empty(
    $errors) === false) { 
            echo 
    output_errors($errors); 
        } 

    ?>
    come back and mark your original post as resoved if your problem is fixed

    Jamie Garland

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Header Location error

    This line looks suspicious to me:
    PHP Code:
    if (isset($_GET['success']) && empty($_GET['success'])) { 
    Are you really looking to check to see if 'success' it set, but empty? And if so, display the message? It seems to me you would want to check if it is set and not empty.

Posting Permissions

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



Click Here to Expand Forum to Full Width