code error

please guys I’m beginer in php so I need your help in this problem in my code

I want to views the infor of the email in my customer page without affect the page of admin
that code is shown below.
so how can write the query for mysql to retrive the session customerid

[php]//<?php
include(“header.php”);
include(“dbconnection.php”);
if(isset($_GET[“mailid”]))
{
mysqli_query($con,“DELETE FROM mail where mailid=’$_GET[mailid]’”);
$recres = “Mail deleted Successfully…”;
}

// this is line of the error take place
$result = mysqli_query($con,“SELECT * FROM mail where reciverid=’$_SESSION[adminid]’”);
?>

 <div id="templatemo_main">

INBOX

<?php global $recres; echo $recres; ?>
          <?php
	 echo " <tr>";
            echo " <th scope='col' width='45' >Delete</th>";
            echo " <th scope='col'>SENDER</th>";
            echo " <th scope='col'>SUBJECT</th>";
            echo " <th scope='col'>TIME</th>";
            echo " </tr>";
     		while($row = mysqli_fetch_array($result))
			{
			echo " <tr>";
            echo " <th scope='col'><a href='mailinbox.php?mailid=$row[mailid]'>Delete</a></th>";
            echo " <th scope='col'>$row[senderid]</th>";
            echo " <th scope='col'>$row[subject]</th>";
            echo " <th scope='col'>$row[mdatetime]</th>";
            echo " </tr>";
			}

?>



<?php[/php]

this is error occor in the page I want to resolve it

//Notice: Undefined index: adminid in C:\xampp\htdocs\design\mailinbox.php on line 9

Just like the error says, on line 9, there is nothing there for $_SESSION[adminid]

Most likely - the admin is not logged in. You can see what is stored in the session variable by putting this at the top of your page:

[php]

<?php echo '
';
print_r($_SESSION);
echo '
'; [/php] For future reference, put your source code into code tags in here. It's also useful to give an explanation of what you have tried and what your thoughts are as other people will be unwilling to help if you haven't bothered to try yourself.

I was try it the code but unfortunalty it doesn’t work

Sponsor our Newsletter | Privacy Policy | Terms of Service