hey
i have two pages : inbox & viewmessage.
when i click on a title in my inbox, i want to view the whole message in the other page.
--------------------- CODE inbox.php -------------------------------
<?
require( "functions.php" );
session_start();
if ( !IsSet( $_SESSION['userid'] ) ) {
header( "Location: login.php" );
exit;
}
displayHeader( "INBOX" );
echo "<center><h4>INBOX</h4></center>";
$userid = $_SESSION['userid'];
dbConnect();
$result = mysql_query( "SELECT messageid, userid, receiverid, topic, titel, time FROM message WHERE receiverid = '$userid' ORDER BY time DESC" );
$foundNum = mysql_num_rows( $result );
$userid = stripslashes( $userid );
echo "
<center>
<table border=0 cellpadding=0 cellspacing=0 width=80%>
<tr>
<td width=100% height=20 colspan=2><small>Found <b>$foundNum</b> match topic '$userid'</small></td>
</tr>
<tr>
<td width=100% height=1 bgcolor=#808080 colspan=2></td>
</tr>";
$i = 1;
while( $row = mysql_fetch_array( $result ) )
{
$messageid =$row['messageid'];
// $_SESSION['messageid'] = $messageid;
echo "
<tr>
<td width=3% height=20><b>$i.</b></td>
<td width=97% height=20><a href=viewmessage.php?messageid=$messageid>{$row[ 'titel' ]}</a> <font color=#808080><small>- " .
strftime( "%c", $row[ 'time' ] ) . "</small></font></td>
</tr>
<tr>
<td width=3% height=20></td>
<td width=97% height=20><a href=viewprofile.php?id=$userid>{$row[ 'userid' ]}</a></td>
</tr>";
$i++;
}
echo "
<tr>
<td width=100% height=1 bgcolor=#808080 colspan=2>
</tr>
</tr>
</table>
</center>";
echo "
<p align=center><a href=forum.php>Thread Index</a> | <a href=javascript:history.back()>Back</a></p>";
displayFooter();
?>
------------------------CODE viewmessage.php--------------------
<?
require( "functions.php" );
session_start();
if ( !IsSet( $_SESSION['userid'] ) ) {
header( "Location: inbox.php" );
exit;
}
displayHeader( "VIEWMESSAGE" );
echo "<center><h4>VIEWMESSAGE</h4></center>";
// $userid = $_SESSION['userid'];
dbConnect();
$result = mysql_query( "SELECT messageid, userid, receiverid, topic, titel, msg, time FROM message WHERE messageid = '$message'" );
$foundnum = mysql_num_rows( $result );
$messageid = stripslashes( $messageid );
echo "
<center>
<table border=0 cellpadding=0 cellspacing=0 width=80%>
<tr>
<td width=100% height=20 colspan=2><small>Found <b>mm</b> match topic $foundnum</small></td>
</tr>
<tr>
<td width=100% height=1 bgcolor=#808080 colspan=2></td>
</tr>";
// $i = 1;
while( $row = mysql_fetch_array( $result ) )
{
echo "
<tr>
<td width=3% height=20><b>$messageid</b></td>
<td width=97% height=20>{$row[ 'titel' ]} <font color=#808080><small>- " .
strftime( "%c", $row[ 'time' ] ) . "</small></font></td>
</tr>
<tr>
<td width=3% height=20></td>
<td width=97% height=20><a href=viewprofile.php?id=$userid>{$row[ 'userid' ]}</a></td>
</tr>";
// $i++;
}
echo "
<tr>
<td width=100% height=1 bgcolor=#808080 colspan=2>
</tr>
</tr>
</table>
</center>";
echo "
<p align=center><a href=forum.php>Thread Index</a> | <a href=javascript:history.back()>Back</a></p>";
displayFooter();
?>
the problem is that he doesn't want to show the code.
is there anyone who know how to do it? maybe with a second session var called messageid?
greetz,
betacrash