Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php header() not working on a ssl website

Tags:

php

ssl

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");
like image 329
Saikat Bepari Avatar asked Feb 22 '26 20:02

Saikat Bepari


1 Answers

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

like image 146
Saikat Bepari Avatar answered Feb 24 '26 10:02

Saikat Bepari