I've been trying to sort this out for a while now, but i can't seem to do it, when you reply to a mail someone sends you, you have to manually type in there name, and people usually forget too, and press send and then lose everything they've wrote, about 30 of my members have complained to me about this, i'd be really grateful if someone could help.
I think it's this bit;
<table width='100%'>
<form method='post'>
<tr>
<td width='15%'>Send To:</td>
<td width='85%'><input type='text' name='to' value='<?php echo $_GET['to'] ?>' size='20' maxlength='75'> [username]
</tr>
<tr>
<td width='15%'>Subject:</td>
<td width='85%'><input type='text' name='subject' size='70' maxlength='75' value='<? echo ($_GET['reply'] != "") ? "Re: ".$worked2['subject'] : ""; ?>'></td>
</tr>
<tr>
<td width='15%'>Message:</td>
<td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7' id='message'><? echo ($_GET['reply'] != "") ? " \n -------- \n ".$worked2['msgtext'] : ""; ?></textarea></td>
</tr></tr> <tr>
<td width='100%' colspan='4' align='center'><input type='submit' name='newmessage' value='Send'></td>
</tr>
</form>
</table>
</td></tr>
But here is the rest just incase it's not;
<?include 'header.php';
function howlongqwe($ts) { $ts=time() - $ts; return floor($ts/1);};
if ($_GET['delete'] != ""){
$deletemsg = $_GET['delete'];
$result = mysql_query("DELETE FROM `pms` WHERE `id`='".$deletemsg."' AND `to`='".$user_class->username."'");
echo Message("Message Deleted!");
}
if ($_GET['deleteall'] == "true"){
$result = mysql_query("DELETE FROM `pms` WHERE `to`='".$user_class->username."' AND `viewed`>'1'");
echo Message("All viewed messages deleted!");
}
//make sure they can only pm once every 30 seconds
$resultbb = mysql_query("SELECT * from `pms` WHERE `from`='".$user_class->id."' ORDER BY `id` DESC LIMIT 1"); $rowb = mysql_fetch_array($resultbb);
$ifhaslastpm = mysql_num_rows($resultbb);
$timeleft = 31;if($ifhaslastpm > 0){
$ts = $rowb['timesent'];
$timeleft = howlongqwe($ts);}
if ($_POST['newmessage'] != ""){
if($timeleft < 30){$timeleft2 = 30 - $timeleft;echo Message("You can only PM once per 30 seconds. Please try again in ".$timeleft2." seconds [[url='pms.php']Back[/url]].");include 'footer.php';die();}
$to = $_POST['to'];
$from = $user_class->id;
$timesent = time();
$subject = strip_tags($_POST['subject']);
$msgtext = strip_tags($_POST['msgtext']);
$msgtext = str_replace ('mafiacrossfire', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('redneckbattle', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('musicbattle', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('music battle', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('mafiarecon', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('chavgangs', 'Mafiadeeds', $msgtext);
$msgtext = str_replace ('lostpowercity', 'Mafiadeeds', $msgtext);
$subject = str_replace ('mafiacrossfire', 'Mafiadeeds', $subject);
$subject = str_replace ('redneckbattle', 'Mafiadeeds', $subject);
$subject = str_replace ('musicbattle', 'Mafiadeeds', $subject);
$subject = str_replace ('music battle', 'Mafiadeeds', $subject);
$subject = str_replace ('refer', 'Do not go to this website', $subject);
$subject = str_replace ('refid', 'Do not go to this website', $subject);
$subject = str_replace ('mafiarecon', 'Mafiadeeds', $subject);
$subject = str_replace ('chavgangs', 'Mafiadeeds', $subject);
$subject = str_replace ('lostpowercity', 'Mafiadeeds', $subject);
$subject = str_replace ('the-la-costra-notras', 'Mafiadeeds', $subject);
if ($subject==""){ $subject="No Subject"; }
$checkuser = mysql_query("SELECT `username` FROM `opexusers` WHERE `username`='".$to."'");
$username_exist = mysql_num_rows($checkuser);
if($username_exist > 0){
$result= mysql_query("INSERT INTO `pms` (`to`, `from`, `timesent`, `subject`, `msgtext`)".
"VALUES ('$to', '$from', '$timesent', '$subject', '$msgtext')");
echo Message("Message successfully sent to $to");
} else {
echo Message('I am sorry but the Username you specified does not exist...');
}
}
?>
<tr><td class="contenthead">Mailbox</td></tr><tr><td class="contentcontent"><center><font color="red">[b]NOTE:[/b]</font>[i] The admin or moderator will NEVER ask for your password![/i]</center></tr></td><tr><td class="contentcontent"><center><font color="red">[b]NOTE:[/b]</font>[i] Do not swear, use offensive language, beg more than twice or advertise other things not in game.[/i]</center></tr></td><tr><td class="contentcontent"><center><font color="red">[b]NOTE: WHEN REPLYING TO A MAIL, REMEMBER TO ADD IN THE RECIPITENTS USERNAM, OTHERWISE IT WILL NOT BE SENT!![/b]</font></tr></td><tr><td class="contentcontent">
<center>[url='pms.php?deleteall=true']Delete All Viewed/Read Messages[/url]</center></tr></td><tr><td class="contentcontent">
<table width='100%'>
<tr>
<td class="contenthead" align="center">Time Recieved</td>
<td class="contenthead" align="center">Subject</td>
<td class="contenthead" align="center">From</td> <td class="contenthead" align="center">Viewed</td>
<td class="contenthead" align="center">Delete</td>
</tr>
<?
$result = mysql_query("SELECT * FROM `pms` WHERE `to`='$user_class->username' ORDER BY `timesent` DESC");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$from_user_class = new User($row['from']);
$subject = $row['subject'];
if ($subject==""){ $subject="No Subject"; } if ($row['viewed']=="1"){ $viewed="No"; }else{ $viewed="Yes"; }
echo "
<tr class='contentcontent' align=center>
<td width='20%'>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$row['timesent'])."</td>
<td width='20%'>[url='viewpm.php?id=".$row[']".$subject."[/url]</td>
<td width='20%'>".$from_user_class->formattedname."</td> <td width='20%'>".$viewed."</td>
<td width='20%'>[url='pms.php?delete=".$row[']Delete[/url]</td>
</tr>
";
}
if ($_GET['reply'] != ""){
$result2 = mysql_query("SELECT * from `pms` WHERE `id`='".$_GET['reply']."'");
$worked2 = mysql_fetch_array($result2);
$from_user_class = new User($worked2['from']);
}
?></table>
</td></tr>
<tr><td class="contenthead">New Message</td></tr><tr><td class="contentcontent"><script language="JavaScript" type="text/javascript"></script>
<table width='100%'>
<form method='post'>
<tr>
<td width='15%'>Send To:</td>
<td width='85%'><input type='text' name='to' value='<?php echo $_GET['to'] ?>' size='20' maxlength='75'> [username]
</tr>
<tr>
<td width='15%'>Subject:</td>
<td width='85%'><input type='text' name='subject' size='70' maxlength='75' value='<? echo ($_GET['reply'] != "") ? "Re: ".$worked2['subject'] : ""; ?>'></td>
</tr>
<tr>
<td width='15%'>Message:</td>
<td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7' id='message'><? echo ($_GET['reply'] != "") ? " \n -------- \n ".$worked2['msgtext'] : ""; ?></textarea></td>
</tr></tr> <tr>
<td width='100%' colspan='4' align='center'><input type='submit' name='newmessage' value='Send'></td>
</tr>
</form>
</table>
</td></tr>
<?
include 'footer.php';
?>
Thanks for reading.