<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Player Mailbox</title>
<STYLE>
.title { text-align: center; font-size: 1.75em; font-weight: bold; text-decoration: underline; color: blue; }
.bold { font-weight: bold; }
#First { margin-left: 40%; margin-right: 40%; }
.error { text-align: center; color: red; }
#Second { margin-left: 40%; margin-right: 40% }
#Third { text-align: center; color: red; }
</STYLE>
</head>
<body>
<p class='title'>Mailbox Tool</p>
<?php
$mssql = array(
'host' => "localhost",
'user' => "sa",
'pass' => "password"
);
$gm = '[GM]Tester'; /* Enter the GM name you want in the mail */
$text1 = 'A gift for you'; /* Enter text you want in the subject of the mailing */
$text2 = 'Hope you enjoy it'; /* Enter the greeting you want inside the mailing */
/* ---------- DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING! --------------- */
/* ------------------------------2009 by Maestro ----------------------------------------- */
if(empty($_POST['select'])) {
echo "
<div id='First'>
<form method='POST'>
<input type='hidden' name='select' value='1'>
<table>
<tr><td class='bold'>Enter Player Name</td></tr>
<tr><td><input type='text' name='charname' /></td></tr>
<tr><td><input type='submit' value='Submit'></td></tr>
</table>
</form>
</div>
";
} elseif($_POST['select'] == '1') {
$ms_con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
$result1 = mssql_query("SELECT * FROM character.dbo.user_character WHERE character_name = '".$_POST['charname']."'",$ms_con);
$count1 = mssql_num_rows($result1);
if($count1 < '1') {
echo "<div class='error'><p>Character not found.</p><p><a href='./mailbox.php'>Back</p></div>";
} elseif($count > '1') {
echo "<div class='error'><p>Too many results.</p><p><a href='./mailbox.php'>Back</p></div>";
} else {
$result2 = mssql_query("SELECT user_no,character_no FROM character.dbo.user_character WHERE character_name = '".$_POST['charname']."'",$ms_con);
$row2 = mssql_fetch_row($result2);
echo "
<div id='Second'>
<form method='POST'>
<input type='hidden' name='select' value='2'>
<table>
<tr><td class='bold'>Player Name:</td></tr>
<tr><td><input type='text' name='charname' maxlength='20' value='".$_POST['charname']."' readonly='readonly' size='20'></td></tr>
<tr><td class='bold'>Player Number:</td></tr>
<tr><td><input type='text' name='char_no' value='".$row2[1]."' readonly='readonly' size='25'></td></tr>
<tr><td class='bold'>Item index:</td></tr>
<tr><td><input type='text' name='item' value='0' /></td></tr>
<tr><td class='bold'>Dil Amount:</td></tr>
<tr><td><input type='text' name='dil' value='0' /></td></tr>
<tr><td><input type='submit' value='Submit'></tr>
</table>
</form>
</div>
";
}
} elseif($_POST['select'] == '2') {
$ms_con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
mssql_query("EXEC character.dbo.SP_POST_SEND_OP '".$_POST['char_no']."','".$gm."',1,'".$text1."','".$text2."','".$_POS T['item']."','".$_POST['dil']."',0",$ms_con);
echo "
<div id='Third'>
<p class='done'>Item and dil have been sent to '".$_POST['charname']."'</p>
<p><a href='./mailbox.php'>Back</a></p>
</div>
";
}else{
echo "<p class='error'>Something must have gone wrong</p><p><a href='./mailbox.php'>Back</a></p>";
}
?>
</body>
</html>
sorry i don't know how to use spoiler but the txt in red is what you needto change for mailbox.php to work properly. have fun.