Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7173925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:55:35+00:00 2026-05-28T15:55:35+00:00

Short During debug process I see that, all goes right. For debugging purposes, before

  • 0

Short

During debug process I see that, all goes right. For debugging purposes, before

header('Location:'.wsurl.'me.php');

Asigning generated url

$redirect=wsurl.'me.php';

And Netbeans shows right url adress

But on browser windows getting this screen

http://img849.imageshack.us/img849/9861/c6949d6ea7ba47909d2cc37.png

And it doesn’t redirect to any url: just stays where it is.

Question

What prevents redirection?

Detailed

Here is full code of signin method

  public function signin() {
        if ($this->validation->check()) {
            foreach ($_POST as $k => $v)
                $$k = $v;

            $stmt = $this->db->prepare("
    SELECT u.id,    u.fname,    u.lname,    u.mname,  u.type, u.email, u.salt,
           u.pass,  u.salt,     u.approved, u.ban,      u2.status
    FROM `users` AS u
        LEFT OUTER JOIN `log` AS u2
            ON u2.user_id = u.id
    WHERE u.email = ? LIMIT 1") or die($this->db->error);

            $stmt->bind_param("s", $email) or die($stmt->error);
            $stmt->execute() or die($stmt->error);
            $stmt->store_result();
            $ip = ip2long($ip);
            if ($stmt->num_rows > 0) {
                $stmt->bind_result($id, $fname, $lname, $mname, $type, $email, $salt, $db_pass, $salt, $approved, $ban, $status) or die($stmt->error);
                $stmt->fetch() or die($stmt->error);
                $stmt->close();
                if ($status != 1) {
                    if ($approved == 1) {
                        if ($ban == 0) {
                            $hash = hash('sha256', $salt . hash('sha256', trim($pass)));
                            if ($hash == $db_pass) {
                                $token = sha1(microtime(true) . mt_rand(10000, 90000));
                                if (isset($remember) && $remember == "on") {

                                    $timeout = time() + 60 * 60 * 24 * COOKIE_TIME_OUT;

                                    $stmt = $this->db->prepare("INSERT INTO `log` (`user_id`,`ip`, `token`, `timeout`, `status`,`signin_dt`) VALUES (?,?,?,?,1,NOW())") or die($db->error);
                                    $stmt->bind_param("iiiii", $id, $ip, $token, $timeout) or die($stmt->error);
                                    setcookie('auth', "$token", $timeout);
                                } else {
                                    $stmt = $this->db->prepare("INSERT INTO `log`  (`user_id`,`ip`, `status`,`signin_dt`) VALUES (?,?,1,NOW())") or die($db->error);
                                    $stmt->bind_param("ii", $id, $ip) or die($stmt->error);
                                    session_start();
                                    session_regenerate_id(true); //this is a security measure
                                    $_SESSION['user_id'] = $id;
                                    $_SESSION['token'] = $token;
                                    $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);
                                    $_SESSION['remote_ip'] = $_SERVER['REMOTE_ADDR'];
                                }
                                $stmt->execute() or die($stmt->error);
                                $stmt->close();                                    
                                $redirect=wsurl.'me.php';
                                header('Location: '.$redirect); die;
                            } else {
                                die($this->ajax->respond(3));
                            }
                        } else {
                            die($this->ajax->respond(4));
                        }
                    } else {
                        die($this->ajax->respond(5));
                    }
                } else {
                    die($this->ajax->respond(6));
                }
            } else {

                die($this->ajax->respond(7));
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:55:36+00:00Added an answer on May 28, 2026 at 3:55 pm

    If ajax_respond() sends output to the browser, you cannot follow that with a header() call, since output will already have been sent. An AJAX response is not typically followed by any redirection, since the client browser is not intended to reload the page. Instead the AJAX response is processed in the page and no redirection takes place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to debug a crash that happens in our application during garbage collection
I am trying to debug a large and complex webapp that makes heavy use
During debugging in Eclipse , my code went into the while loop ( I
I have a very short Java application that just opens a connection to a
I want DWR to transparently batch all remote calls that are done in the
I have a simple application that adds about 7 million short strings to a
While debugging some C# code during a sort of peer-review, I noticed an odd
SHORT VERSION: How can I load classes during runtime from a bundle, when those
There are short code snippets I often use during my Rails script/console sessions, like
In short: How would I check the type of a UI user control during

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.