PHP - how to read message on the next page by clicking on the subject

Asked By Olusegun A. on 05-Oct-09 05:31 PM

am designing a social website where friends can send message to one another. i have designed the indox page named inbox.php where list of all messages will be displayed. the inbox table will display the SENDER, SUBJECT and DATE. the subject the an hyperlink that will direct the member to read the message. I also design another page named readmsg.php where the message which subject is being clicked in the inbox.php will be read, this page will show the SENDER, DATE SENT, SUBJECT & MESSAGE. the code for the subject is as below

<a href="readmsg.php?id=$id">$subject</a>


The problem is that whenever the subject is being clicked in the inbox.php, i will be directed to readmsg.php but the field of SENDER, DATE SENT, SUBJECT & MESSAGE will be blank it won't show the info. i tried to create and pass it to SESSION[read] but its now working because i already have a SESSION[member]. please what do I do?

reply - Deepak Sonawane replied to Olusegun A. on 06-Oct-09 12:32 AM

Hi,
You want to send information from one page to another then u can do following things:
Form one code:
<form name="form1" action="page2.php" method="post">
<input type="text" name="var1" value=""> // this will contain your subject ,message,etc
<input type="submit" name="submit" value="submit">
</form>

Form two code
on a separate web page:
<form name="form2" action="page3.php" method="post">
<input type="hidden" name="var1" value="
<?=$_POST['var1'];?>"/>
<input type="submit" name="submit" value="submit"/>
</form>