0

<?php

session_start();

?>

line 39: <?php echo $_SESSION['banner']; ?>
line 40: <?php echo $_SESSION['banner']; ?>

Notice: Undefined index: banner in C:\xampp\htdocs\portal\administrator2\admin\dashboard.php on line 39

Notice: Undefined index: banner in C:\xampp\htdocs\portal\administrator2\admin\dashboard.php on line 40

How to fix the error?

5
Contributors
6
Replies
28
Views
2 Years
Discussion Span
Last Post by OsaMasw
1

Is banner set?

 if (isset($_SESSION['banner'])) {
   echo $_SESSION['banner'];
 }

Edited by JorgeM

-1

you can try to use define()

if (defined($_SESSION['banner'])) {
    echo $_SESSION['banner'];
}else{
    echo "$_SESSION['banner'] not defined";
}
0

I place this code:

<?php
        if (defined($_SESSION['banner'])) {
            echo $_SESSION['banner'];
        }else{
            echo "not defined";
        }
        ?>

The result is not defined.

How to define $_SESSION['banner']? I already place

<?php 

session_start();

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.