0

I want to ask something about my code.

Here is my main.php code:

<?php 
session_start();
require"config/connection.php";
?>
<div>
  <tr>
    <td>
        <?php require "template/header_new.php"; ?>
    </td>
  </tr>
</div>

When I run the code, an error mention this:
Notice: Undefined index: first_name in \template\header_new.php on line 29

Here is my header_new.php:

<span style="line-height:28px"><strong><font color="#00674e"><?= $_SESSION["first_name"]?></font> | <a href="logout.php">Logout</a></strong></span></div>

One thing that makes me confused, it is running well in development server. But, the error appeared once I migrate the app to the production server. In the production server looks like the code doesn't save php session.

Is this php version issue or other issues that I still haven't discovered yet?

PS: The app running in PHP 5.3.28 version
MySQL is running in development server.
MariaDB is running in production server

Thank you

Rendy
  • 19
  • 1
  • 1
  • 4

0 Answers0