<?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?

Is banner set?

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

you can try to use define()

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

$_SESSION['banner'] is not set as guys mentioned earlier

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();

?>
Member Avatar for diafol

you can try to use define()

That's used to check named CONSTANTS: http://php.net/manual/en/function.defined.php

Do not use this on variables. isset() is what you need. C'mon davy - a DW veteran of three years?

where does $_SESSION['banner'] get its value ??
from database or from form ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.