Location: PHPKode > scripts > OekakiPoteto > oekakipoteto/mailread.php
<?
include('dbconn.php');
include('flagchk.php');
$result = mysql_query("SELECT usrname, usrflags FROM ".$OekakiPoteto_MemberPrefix."oekaki WHERE usrname='$OekakiU'");
extract(mysql_fetch_array($result));
if (!check_flag('G')) {
	header('Location: error.php?error='.urlencode("You cannot access the mailbox."));
exit;
}
$result = mysql_query("SELECT * FROM ".$OekakiPoteto_MemberPrefix."oekakimailbox WHERE MID='$MID'");
$row = mysql_fetch_array($result);
if(($row[reciever] != $OekakiU) && ($row[sender] != $OekakiU)) {
		header('Location: error.php?error='.urlencode("You cannot access messages in the mailbox that do not belong to you."));
		exit;
}

if($row[reciever] == $OekakiU){
$result = mysql_query("UPDATE ".$OekakiPoteto_MemberPrefix."oekakimailbox set mstatus = 2 WHERE MID='$MID'");
}
mysql_close($dbconn);
?>

<html>
<?
include('header.php');
$result = mysql_query("SELECT * FROM ".$OekakiPoteto_MemberPrefix."oekakimailbox WHERE MID='$MID'");
$row = mysql_fetch_array($result);
mysql_close($dbconn);
?>
<p></p>
<br>
<form name="form1" method="post" action="functions.php?mailbox=send">
<table width="<?=$hWidth?>" cellpadding="<?=$hCellPadding?>" align="center">
    <tr> 
      <td class="infotable"><font size="-2"><strong><?=$langop_word_mailbox?></strong> [<a href="mailbox.php"><?=$langop_word_inbox?></a>] 
        [<a href="mailout.php"><?=$langop_word_outbox?></a>] [<a href="mailsend.php?sendto=<?=$row[sender]?>&MID=<?=$row[MID]?>&action=reply"><?=$langop_word_reply?></a>] [<a href="functions.php?mail=delete&MID=<?=$row[MID]?>">Delete</a>]</font></td>
    </tr>
    <tr> 
      <td ><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr > 
            <td class="header"><strong><?=$langop_readm_title?></strong></td>
          </tr>
          <tr >
            <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="infotable">
                <tr> 
                  <td ><strong><?=$langop_word_from?>: <a onClick="openWindow('profile.php?user=<?=urlencode($row[sender]);?>', 300, 400); return false"> 
                    <?=$row[sender];?>
                    </a> @ <font color="<?=$dStamp?>"> 
                    <?=$row[senddate]?>
                    </font></strong></td>
                </tr>
                <tr> 
                  <td height="25" ><strong><?=$langop_word_subject?>:</strong> 
                    <?=nifty2_convert($row[subject]);?>
                  </td>
                </tr>
                <tr> 
                  <td valign="top">&nbsp;</td>
                </tr>
                <tr> 
                  <td valign="top"> 
                    <?=nifty2_convert($row[body]);?>
                  </td>
                </tr>
                <tr> 
                  <td height="20" valign="top">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
        </table></td>
    </tr>
  </table>
  <br>
</form>
</body>
<? include('footer.php'); ?>
Return current item: OekakiPoteto