<?php
<?php
iseedeadpeople();
switch (1) {
default:
if ($webshop['credits']['namechg']<1) {
print phrase_blocked_module;
break;
}
if ($_POST['newname']) {
require 'inc/function.checkstatus.php';
$query = mssql_query("select [AccountID] from [Character] where [Name]='".secure($_POST['character'])."'");
$result = mssql_fetch_row($query);
if ($webshop['credits']['namechg']>$mycreds)
{
print phrase_lack_credits;
break;
}
if ($result[0]!=$GLOBALS['mu_user'])
{
print 'That character does not belong to you!';
break;
}
if (checkstatus($_POST['character']))
{
print phrase_offline_rq;
break;
}
if (strlen($_POST['newname'])<2 || strlen($_POST['newname'])>10)
{
print 'The new character name does not match the length specifications';
break;
}
$query = mssql_query("select [Name] from [Character] where [Name]='".secure($_POST['newname'])."'");
$result = mssql_fetch_row($query);
if ($result[0])
{
print 'A character with that name already exists, please select another one';
break;
}
mssql_query("exec XCredits '".$GLOBALS['mu_user']."', '".($webshop['credits']['namechg']*-1)."'");
shoplog("The character <b>".htmlspecialchars($_POST['character'])."</b> changed his name to <b>".htmlspecialchars($_POST['newname'])."</b>");
mssql_query("
update [Character] set [Name]='".$_POST['newname']."' where [Name]='".$_POST['character']."';
update [AccountCharacter] set [GameID1]='".$_POST['newname']."' where [GameID1]='".$_POST['character']."';
update [AccountCharacter] set [GameID2]='".$_POST['newname']."' where [GameID2]='".$_POST['character']."';
update [AccountCharacter] set [GameID3]='".$_POST['newname']."' where [GameID3]='".$_POST['character']."';
update [AccountCharacter] set [GameID4]='".$_POST['newname']."' where [GameID4]='".$_POST['character']."';
update [AccountCharacter] set [GameID5]='".$_POST['newname']."' where [GameID5]='".$_POST['character']."';
update [AccountCharacter] set [GameIDC]='".$_POST['newname']."' where [GameIDC]='".$_POST['character']."';
update [Guild] set [G_Master]='".$_POST['newname']."' where [G_Master]='".$_POST['character']."';
update [GuildMember] set [Name]='".$_POST['newname']."' where [Name]='".$_POST['character']."';
update [T_WaitFriend] set [FriendName]='".$_POST['newname']."' where [FriendName]='".$_POST['character']."';
update [T_FriendMail] set [FriendName]='".$_POST['newname']."' where [FriendName]='".$_POST['character']."';
update [T_FRIENDSHIP_STONE] set [CharName]='".$_POST['newname']."' where [CharName]='".$_POST['character']."';
update [T_FriendMain] set [Name]='".$_POST['newname']."' where [Name]='".$_POST['character']."';
update [T_CGuid] set [Name]='".$_POST['newname']."' where [Name]='".$_POST['character']."';
update [OptionData] set [Name]='".$_POST['newname']."' where [Name]='".$_POST['character']."';
");
print mssql_get_last_message();
print "Your character name has been successfully changed";
}
print '<fieldset style="width: 300px"><legend class="mu_style2" style="padding: 0px;font-weight:bold;">Change a character name</legend><div>';
print "<script type=\"text/javascript\">
function amisure() {
if (document.getElementById('newname').value=='') {
alert('Please enter the newname you desire');
return false;
}
if (".$mycreds."<".$webshop['credits']['namechg'].") {
alert('".phrase_lack_credits."');
return false;
}
return webshop_confirm_action('Are you sure you want to change '+document.getElementById('character').value+'\'s name to '+document.getElementById('newname').value+'?');
}
</script>";
$query = mssql_query("select [Name] from [Character] where [AccountID]='".$GLOBALS['mu_user']."'");
$mychars= '';
while($char=mssql_fetch_array($query)) {
$mychars.="<option class=\"clchg\" value=\"".htmlspecialchars($char['Name'])."\">".$char['Name']."</option>";
}
print '<form method="post" action="">
<table width=100% border=0 cellpadding=2 cellspacing=3><tr><td>Character</td><td><select style="color: #000000;" id="character" name="character"><optgroup label="Select a character">'.$mychars.'</select></td></tr><tr><td>New name</td><td>
<input type="text" name="newname" id="newname" maxlength="10" size="10"> (len: <b>2</b>-10)</td></tr>
<tr><td><b>'.$webshop['credits']['namechg'].'</b> credits</td><td><input onClick="return amisure();" type="Submit" value="Change"></td></tr></table>
';
print '</fieldset></div><br><br>';
}
?>
?>
เรื่องที่ 2. เรากฏของการ send mail
ผมตั้งค่าให้ ผมส่งต้องพิมพ์จำนวน ตัวอักษรตามที่กำหนด
ถ้าไม่ผ่านให้กลับไปพิมพ์ใหม่แต่ปัญหาคือ มันไม่ผ่าน แต่ระบบยังทำการ send mail ต่อเหมือนปรกติ
มีวิธีแก้มั้ยครับ