Jump to content

internal mail


chris_s_22

Recommended Posts

im trying to create a internal mail message system.

though I keep running into problems can anyone point me in direction of a good tutorial or help me with mine?

 

so far i got my database.

a page that displays list of messages in brief

a page that displays list of messages sent in brief

 

now i want to be able to delete messages

 

This is code im using to display messages. i also added a form as i thought i need some kind of checkbox and somedata

to be passed then on the maildelete.php im struggling to figure out what i should be checking for and my query

<?php 
include_once 'Connect.php'; //This starts session, connect to database and calls any functions needed
$usernameid = $_SESSION['id'];
$query = ("SELECT * FROM mail WHERE messageto = '$usernameid' ");
$result = mysql_query($query) or die ('failed query.');
$exist = mysql_num_rows($result);  
if($exist=='0')
{
echo"You have no mail";
}
else
{	echo "<form action='maildelete.php' method='POST' name='delete'>";
	echo "<table border='1' cellspacing='1' cellpadding='1'>";
	echo "<tr><td></td><td>FROM</td><td>SUBJECT</td></tr>";
	while ($row = mysql_fetch_assoc($result)) 
	{	  
	$messagefrom = $row["messagefrom"];
	$messagedate = $row["date"];
	$subjecttitle = $row["subjecttitle"];
	$message = $row["message"]; 
	echo "<tr><td><input name='checkdelete' type='checkbox' value='1'></td>";    
	echo "<td>$messagefrom</td>";
	echo "<td><div align='left'>$subjecttitle</div>";
	echo "$message - only want it to display 1st 50 characters...<br>";
	echo "<div align='right'>$messagedate</div></td></tr>";
	}
	echo "<tr><td><input type='submit' value='DELETE' name='submit'></td></tr></table></form>";
}
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.