3

i have a website with ssl , and in my website i used php header() to redirect after user login, successful query, etc. and it is working on my local host. but when i uploaded the site in my hosting with ssl certificate, the header() was not working. why?? any help or idea would be appreciated.

php scripts which are not working:

<?php

session_start(); 

if(!isset($_SESSION['admin'])){ 
    header("location: index.php?You_Must_Login");
    exit();
}

?>

header("Location:create_itinerary.php?Item_Added_Succesfully");
10
  • php.net/manual/en/function.error-reporting.php Commented Nov 24, 2015 at 15:43
  • whats with error_reporting? i didn't got u. Commented Nov 24, 2015 at 15:45
  • 1
    see if anything comes of it. Commented Nov 24, 2015 at 15:48
  • Usually this is because the header already has an output... are you sure nothing is being called before this file / this point? Commented Nov 24, 2015 at 15:52
  • naah... no hope it seems. Commented Nov 24, 2015 at 15:52

1 Answer 1

1

Add <? ob_start(); ?> at starting before 1st <?php and add <? ob_flush(); ?> at last after ?>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.