mail code

hi guy

. I need help in this my mailbox code below
. I want to use this user id

…customerid
…adminid
…employeeid

.to view the information in the database table when one among them session start or login in same page
.what query and condition I can be use?

[php]<?php
session_start();
include(“header.php”);
include(“dbconnection.php”);

if(isset($_GET[“mailid”]))
{
mysqli_query($con,“DELETE FROM mail where mailid=’$_GET[mailid]’”);
$recres = “Mail deleted Successfully…”;
}

$result = mysqli_query($con,“SELECT * FROM mail where reciverid=’$_SESSION[ ]’”);
?>

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

Umm prepared statements!!!

  1. Your variables are not being passed, but you shouldn’t be doing that anyway. When you actually get it passing the variables, add this to the url ( after the equals sign )

[php]’’ or 1;[/php]

Don’t do it on live data, but run it so you understand the importance.

Sponsor our Newsletter | Privacy Policy | Terms of Service