-1

I know this question has been answered many time before but I have applied all things but none of them is working...

This is the code of mine which is in a class, I don't think there is any need to show the working out of the class, I have just passed parameters to class method...

I am stuck at header("Location:Home.php") in this code.. its working on local host but not working on online server.

Every piece of code is working but when it comes to header it does not execute that line. I have tried thousands of time but failed. Please help me. Thanks

if($legal_status == "ok") {

    mysqli_query($this->conn,"update users set current_login='$current_login',status='online' where email='$email'");

    $_SESSION["id"] = $user_id;
    session_regenerate_id(TRUE);
    header("Location:Home.php");

}
yivi
  • 42,438
  • 18
  • 116
  • 138
  • Is your error reporting on? Mention this at the top of the page: `error_reporting(E_ALL);ini_set('display_errors', 1);` – Indrasis Datta Dec 30 '16 at 09:53
  • Without a little bit more information, is impossible to guess. What's setting `$legal_status`, for example. At least provide immediate context, if not the full preceding code in this method. – yivi Dec 30 '16 at 10:06
  • yeah my error_reporting is on.. – Waqas Hassan Dec 30 '16 at 15:54

1 Answers1

-1

if the code is working on your local server but not online the answer is probably in the server configurations.

The good things to do is to compare the PHP version and even better compare the PHP modules on your server.

Maybe your server don't have the same PHP module activated with your local environnement.

You can see all the PHP configuration of your online server by putting phpinfo() in a php file on it.