how to read message from inbox

i wants to read a message from inbox.
from my database i wants to read a message which i clicked.

<?php $id=$_SESSION['id'];------STORES SESSION ID require ('connect.php');---------CONNECTS TO DATABASE //if user not logged in if(!isset($_SESSION['id']) || (trim($_SESSION['id'])=='')) { header("location: index.php"); exit(); } //if valid session then $inbox = mysql_query("SELECT * FROM messages WHERE receiver='$id' ORDER BY date LIMIT 5"); //TO FETCH DATA FROM MESSAGE TABLE while ($msg = mysql_fetch_assoc($inbox)) { $mid = $msg['id']; $sender = $msg['sender']; $title = $msg['title']; $date = $msg['date']; //QUERY TO GET SENDER NAME FROM TABLE $sn = mysql_query("SELECT fn FROM user WHERE id ='$sender'"); $nm = mysql_fetch_assoc($sn); $nm =$nm['fn']; //DISPLAY SENDER NAME,TITLE(as a link)AND DATE echo "

".$nm.":"."Title-".$title.""."
".$date."


"; } ?>

now the other file is read.php that will retrieve selected message but how to tell the file which message is selected?

Sponsor our Newsletter | Privacy Policy | Terms of Service