
<?php 
session_start();
 if(!isset($_SESSION['email']))
  { $_SESSION['email'] = $_POST['email']; }
if(!isset($_SESSION['password'])) 
{ $_SESSION['password'] = $_POST['password']; } ?>
<html>
<head>
<title>The Science Network</title>

<link rel="stylesheet" type="text/css" href="style.css" />
</head>
	<body style="background-color:#E8E8E8">
    	<center>
    	<table width="768" border="0" style="background-color:#666666;">
  <tr>
    <td colspan="2"><img src="./logo2.gif" width="763" height="108" alt="logo"></td>
    </tr>
   <tr>
    <td colspan="2" valign="middle" style="background-color:#666;">
   
    </td>
    </tr>
   <tr>
    <td width="585" style="background-color:#FFF; vertical-align:top; text-align:center">
    <?php		        
		
$db = mysql_connect("localhost","root","mysql");           /* start connection with database */

echo "<br>";
if (!$db)                                                       /* conditional statement */
{
die('Connection to Database down: '. mysql_error());            /* print if connection is not established */
}

mysql_select_db("ScientistNet", $db); 


 $id = $_POST['mid'] ;  
 //echo "$id";
 echo "<br />";
 // delete query 
$sql =mysql_query("DELETE FROM Mail 
WHERE id=$id ") 
                     or die(mysql_error());
 	$del = gettype($sql);					 
 
 // check if query correct or not
 if($del==0) 
 {print "Message Deleted!"; }
 else 
 {print "Error"; }
 
 

 ?>
       </p>
    </td>
    <td width="173" align="center" valign="middle" class="sidebar" style="background-color:#CCC">
    <a href="./mail.php">Close</a>
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center" valign="middle" style="background-color:#666; color:#FFF;">The Science Network, 2012&copy;</td>
    </tr>
</table>

	</body>
</html>
