chris_s_22 Posted December 5, 2009 Share Posted December 5, 2009 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 https://forums.phpfreaks.com/topic/184125-internal-mail/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.