error code

0 JUMA NASSOR · May 23, 2015
hi guys 

 i was build my page  of mail as ....


//code

<?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...";
}
//error in line below
$result = mysqli_query($con,"SELECT * FROM mail where reciverid='$_SESSION[customerid]'");
?>
    
     <div id="templatemo_main">
  <div align="center"><span class="main_top"></span> 
    
  </div>
  <div align="center"></div>
  <div id="templatemo_content">
      <h2 align="center">INBOX</h2>
            <?php
            global $recres;
             echo $recres; ?>
         <table width="600" border="1">
    
             
              <?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>";
  }
?>           
      </table>
         </form>
        <?php

?>


so the problem is  i want to use this page to view the details of customer and admin when logged in as in session 
the session start are include in a header page ,

but  this error take place when  I views the mail of customer  in admin dashbody

//error 

Notice: Undefined index: customerid in C:\xampp\htdocs\design\mailinbox.php on line 11

please I need your help guys 

Post a Reply

Replies

Oldest  Newest  Rating
0 Eyeshield Rosalin · May 24, 2015
is your query correct and the same with your database?
0 JUMA NASSOR · May 24, 2015
my query is correct by l don't know where error come from?
0 Azim Udin · May 24, 2015
it seems value for customerid is not stored in session.
try
<pre>
<?php print_r($_SESSION); ?>
</pre>

at the start of the page to look up your stored session
  • 1

PHP

107,128 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators