|
|
|
อยากใช้ tis-620 กับ ajax ทำไงครับ โดยไม่ต้องแก้เป็น utf-8 |
|
|
|
|
|
|
|
ก็ใช้ windows-874 ครับ
|
|
|
|
|
Date :
2011-08-25 08:34:07 |
By :
Professer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ครับ คือตอนนี้หน้าเพจ php ทั้งหมดเป็น windows-874 แต่ปัญหาคือค่าที่ส่งมาจาก ajax เป็นภาษาต่างดาว ทั้งๆที่หน้านั้นก็กำหนดเป็น windows-874 เหมือนกัน (หรือผมเข้าใจคำอธิบายคุณ Mr. อีฟ ผิด)
|
|
|
|
|
Date :
2011-08-25 08:43:18 |
By :
turesjung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองใช้ iconv("UTF-8","window-874",ค่าที่ส่งมา); ดูครับ
|
|
|
|
|
Date :
2011-08-25 09:37:47 |
By :
kalamell |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาโค้ดมาวางด้วยครับ
|
|
|
|
|
Date :
2011-08-25 09:46:22 |
By :
ไวยวิทย์ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customer_exe.php
Code (PHP)
<?
session_start();
include "function.php";
include "connectDB.php";
if($_SESSION["login_true"] =="")
{
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
exit(0);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
function checkVal1(x)
{
if (x.cust_code.value == "")
{
alert('กรุณากรอกรหัสสมาชิก');
return false;
}
if (x.cust_name.value == "")
{
alert('กรุณากรอกชื่อ-สกุลสมาชิก');
return false;
}
if (x.upline_code.value == "")
{
alert('กรุณากรอกรหัสผู้แนะนำ');
return false;
}
if (x.upline_name.value == "")
{
alert('กรุณากรอกชื่อ-สกุลผู้แนะนำ');
return false;
}
}
var HttPRequest = false;
function doCallAjax()
{
HttPRequest = false;
if(window.XMLHttpRequest)
{
HttPRequest = new XMLHttpRequest();
if(HttPRequest.overrideMimeType)
{
HttPRequest.overrideMimeType('text/html');
}
}else if(window.ActiveXObject)
{
try
{
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e)
{
try
{
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
if(!HttPRequest)
{
alert('Cannot create XMLHTTP instance');
return false;
}
var url = 'check_data.php';
var pmeters = "upline_code=" + encodeURI( document.getElementById("upline_code").value);
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 3)
{
document.getElementById("mySpan").innerHTML = "..";
}
if(HttPRequest.readyState == 4)
{
if(HttPRequest.responseText == 'Y')
{
window.location = 'AjaxPHPRegister3.php';
}
else
{
document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
}
}
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>-:- ระบบจัดการศูนย์ Trainning ARAGON 101 -:-</title>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? //include "header.php"; ?></td>
</tr>
<tr>
<td valign="top">
<table width="900" height="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2" bgcolor="8c0000"></td>
<td width="896" align="center" valign="top"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50"> </td>
</tr>
<tr>
<td align="center"><form id="form_addproduct" name="form_addproduct" method="post" action="execute.php" onsubmit="return checkVal1(document.form_addproduct);">
<?
if($s == 0)
{
?>
<table width="450" border="1" bordercolor="#666666" cellspacing="0" cellpadding="0">
<tr>
<td><table width="446" border="0" cellspacing="2" cellpadding="0">
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>รหัสสมาชิก</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_code" type="text" id="cust_code" size="20" maxlength="10" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>ชื่อ-สกุล</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_name" type="text" id="cust_name" size="30" maxlength="100" /> <strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>หมายเลขโทรศัพท์</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_tel" type="text" id="cust_tel" size="20" maxlength="20" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>รหัสผู้แนะนำ</strong></span> </td>
<td align="left" valign="middle" bgcolor="#FF9966">
<input name="upline_code" type="text" id="upline_code" size="20" maxlength="10" /> <strong><span class="alerttxt">*</span></strong> <img src="images/zoom.png" alt="เธเนเธเธซเธฒ" width="20" height="20" align="absmiddle" border="0" onclick="JavaScript:doCallAjax();" onmouseover="this.style.cursor='hand'" /></td>
</tr>
</table>
<span id="mySpan"></span>
</td>
</tr>
<tr>
<td align="center"><label>
<input name="sts" type="hidden" id="sts" value="ac" />
<input type="submit" name="button" id="button" value="เพิ่มข้อมูล" />
</label>
<label>
<input type="reset" name="button2" id="button2" value="ยกเลิก" />
</label></td>
</tr>
</table>
<?
}else if($s == 1){
$result_product = select("tb_product","where product_id = '$id' ");
$arr = mysql_fetch_array($result_product);
?>
<table width="450" border="1" bordercolor="#666666" cellspacing="0" cellpadding="0">
<tr>
<td><table width="446" border="0" cellspacing="2" cellpadding="0">
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธฃเธซเธฑเธชเธชเธกเธฒเธเธดเธ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_code" type="text" id="cust_code" size="20" maxlength="10" value="<? echo $arr["cust_code"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธเธทเนเธญเธชเธกเธฒเธเธดเธ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_name" type="text" id="cust_name" size="30" maxlength="100" value="<? echo $arr["cust_name"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธซเธกเธฒเธขเน€เธฅเธเนเธ—เธฃเธจเธฑเธเธ—เน</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_tel" type="text" id="cust_tel" size="20" maxlength="20" value="<? echo $arr["cust_tel"]; ?>" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธฃเธซเธฑเธชเธเธนเนเนเธเธฐเธเธณ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_code" type="text" id="upline_code" size="20" maxlength="10" value="<? echo $arr["upline_code"]; ?>" />
<strong><span class="alerttxt">*</span></strong> <img src="images/zoom.png" width="20" height="20" alt="เธเนเธเธซเธฒ" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><strong><span class="whitetxt">เธเธทเนเธญ-เธชเธเธธเธฅ </span></strong><span class="whitetxt"></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_name" type="text" id="upline_name" size="30" maxlength="100" value="<? echo $arr["upline_name"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><strong><span class="whitetxt">เธซเธกเธฒเธขเน€เธฅเธเนเธ—เธฃเธจเธฑเธเธ—เน </span></strong><span class="whitetxt"></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_tel" type="text" id="upline_tel" size="20" maxlength="20" value="<? echo $arr["upline_tel"]; ?>" /></td>
</tr>
<tr>
<td width="140" align="right" bgcolor="#8c0000"> </td>
<td width="300" align="left" bgcolor="#FF9966"><span class="alerttxt"> <strong>* เธเธฃเธญเธเธเนเธญเธกเธนเธฅเนเธซเนเธเธฃเธ<br />
</strong></span></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><label>
<input type="hidden" name="id" id="id" value="<? echo $arr["cust_id"]; ?>" />
<input name="sts2" type="hidden" id="sts2" value="ac" />
<input type="submit" name="button3" id="button3" value="เนเธเนเนเธเธเนเธญเธกเธนเธฅ" />
</label>
<label>
<input type="reset" name="button3" id="button4" value="เธขเธเน€เธฅเธดเธ" />
</label></td>
</tr>
</table>
<?
}
?>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="2" bgcolor="8c0000"></td>
</tr>
</table></td>
</tr>
<tr>
<td><? //include "footer.php"; ?></td>
</tr>
</table>
</body>
</html>
check_data.php
Code (PHP)
<?
session_start();
include "function.php";
include "connectDB.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>-:- ระบบจัดการศูนย์ Trainning ARAGON 101 -:-</title>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?
$strTemp = trim($_POST["upline_code"]);
$Result = select("tb_customer","WHERE cust_code = '".$strTemp."' ");
$chk = num_record("tb_customer","WHERE cust_code = '".$strTemp."' ");
$objResult = mysql_fetch_array($Result);
if($chk != 0)
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_name' type='text' id='upline_name' size='30' maxlength='100' disabled='disabled' value='$objResult[cust_name]' /><strong><span class='alerttxt'>*</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_tel' type='text' id='upline_tel' size='20' maxlength='20' disabled='disabled' value='$objResult[cust_tel]' /></td>";
echo "</tr>";
echo "</table>";
}
else
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "</table>";
}
?>
</body>
</html>
ติดตรงที่แสดงผลมันเป็นภาษาต่างดาวครับ
|
|
|
|
|
Date :
2011-08-25 10:10:36 |
By :
turesjung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customer_exe.php
Code (PHP)
<?
session_start();
include "function.php";
include "connectDB.php";
if($_SESSION["login_true"] =="")
{
echo "<meta http-equiv='refresh' content='0;url=index.php'>";
exit(0);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
function checkVal1(x)
{
if (x.cust_code.value == "")
{
alert('กรุณากรอกรหัสสมาชิก');
return false;
}
if (x.cust_name.value == "")
{
alert('กรุณากรอกชื่อ-สกุลสมาชิก');
return false;
}
if (x.upline_code.value == "")
{
alert('กรุณากรอกรหัสผู้แนะนำ');
return false;
}
if (x.upline_name.value == "")
{
alert('กรุณากรอกชื่อ-สกุลผู้แนะนำ');
return false;
}
}
var HttPRequest = false;
function doCallAjax()
{
HttPRequest = false;
if(window.XMLHttpRequest)
{
HttPRequest = new XMLHttpRequest();
if(HttPRequest.overrideMimeType)
{
HttPRequest.overrideMimeType('text/html');
}
}else if(window.ActiveXObject)
{
try
{
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e)
{
try
{
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
if(!HttPRequest)
{
alert('Cannot create XMLHTTP instance');
return false;
}
var url = 'check_data.php';
var pmeters = "upline_code=" + encodeURI( document.getElementById("upline_code").value);
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 3)
{
document.getElementById("mySpan").innerHTML = "..";
}
if(HttPRequest.readyState == 4)
{
if(HttPRequest.responseText == 'Y')
{
window.location = 'AjaxPHPRegister3.php';
}
else
{
document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
}
}
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>-:- ระบบจัดการศูนย์ Trainning ARAGON 101 -:-</title>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><? //include "header.php"; ?></td>
</tr>
<tr>
<td valign="top">
<table width="900" height="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2" bgcolor="8c0000"></td>
<td width="896" align="center" valign="top"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50"> </td>
</tr>
<tr>
<td align="center"><form id="form_addproduct" name="form_addproduct" method="post" action="execute.php" onsubmit="return checkVal1(document.form_addproduct);">
<?
if($s == 0)
{
?>
<table width="450" border="1" bordercolor="#666666" cellspacing="0" cellpadding="0">
<tr>
<td><table width="446" border="0" cellspacing="2" cellpadding="0">
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>รหัสสมาชิก</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_code" type="text" id="cust_code" size="20" maxlength="10" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>ชื่อ-สกุล</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_name" type="text" id="cust_name" size="30" maxlength="100" /> <strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>หมายเลขโทรศัพท์</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_tel" type="text" id="cust_tel" size="20" maxlength="20" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>รหัสผู้แนะนำ</strong></span> </td>
<td align="left" valign="middle" bgcolor="#FF9966">
<input name="upline_code" type="text" id="upline_code" size="20" maxlength="10" /> <strong><span class="alerttxt">*</span></strong> <img src="images/zoom.png" alt="เธเนเธเธซเธฒ" width="20" height="20" align="absmiddle" border="0" onclick="JavaScript:doCallAjax();" onmouseover="this.style.cursor='hand'" /></td>
</tr>
</table>
<span id="mySpan"></span>
</td>
</tr>
<tr>
<td align="center"><label>
<input name="sts" type="hidden" id="sts" value="ac" />
<input type="submit" name="button" id="button" value="เพิ่มข้อมูล" />
</label>
<label>
<input type="reset" name="button2" id="button2" value="ยกเลิก" />
</label></td>
</tr>
</table>
<?
}else if($s == 1){
$result_product = select("tb_product","where product_id = '$id' ");
$arr = mysql_fetch_array($result_product);
?>
<table width="450" border="1" bordercolor="#666666" cellspacing="0" cellpadding="0">
<tr>
<td><table width="446" border="0" cellspacing="2" cellpadding="0">
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธฃเธซเธฑเธชเธชเธกเธฒเธเธดเธ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_code" type="text" id="cust_code" size="20" maxlength="10" value="<? echo $arr["cust_code"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธเธทเนเธญเธชเธกเธฒเธเธดเธ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_name" type="text" id="cust_name" size="30" maxlength="100" value="<? echo $arr["cust_name"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธซเธกเธฒเธขเน€เธฅเธเนเธ—เธฃเธจเธฑเธเธ—เน</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="cust_tel" type="text" id="cust_tel" size="20" maxlength="20" value="<? echo $arr["cust_tel"]; ?>" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><span class="whitetxt"><strong>เธฃเธซเธฑเธชเธเธนเนเนเธเธฐเธเธณ</strong></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_code" type="text" id="upline_code" size="20" maxlength="10" value="<? echo $arr["upline_code"]; ?>" />
<strong><span class="alerttxt">*</span></strong> <img src="images/zoom.png" width="20" height="20" alt="เธเนเธเธซเธฒ" /></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><strong><span class="whitetxt">เธเธทเนเธญ-เธชเธเธธเธฅ </span></strong><span class="whitetxt"></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_name" type="text" id="upline_name" size="30" maxlength="100" value="<? echo $arr["upline_name"]; ?>" />
<strong><span class="alerttxt">*</span></strong></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#8c0000"><strong><span class="whitetxt">เธซเธกเธฒเธขเน€เธฅเธเนเธ—เธฃเธจเธฑเธเธ—เน </span></strong><span class="whitetxt"></span> </td>
<td align="left" bgcolor="#FF9966">
<input name="upline_tel" type="text" id="upline_tel" size="20" maxlength="20" value="<? echo $arr["upline_tel"]; ?>" /></td>
</tr>
<tr>
<td width="140" align="right" bgcolor="#8c0000"> </td>
<td width="300" align="left" bgcolor="#FF9966"><span class="alerttxt"> <strong>* เธเธฃเธญเธเธเนเธญเธกเธนเธฅเนเธซเนเธเธฃเธ<br />
</strong></span></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><label>
<input type="hidden" name="id" id="id" value="<? echo $arr["cust_id"]; ?>" />
<input name="sts2" type="hidden" id="sts2" value="ac" />
<input type="submit" name="button3" id="button3" value="เนเธเนเนเธเธเนเธญเธกเธนเธฅ" />
</label>
<label>
<input type="reset" name="button3" id="button4" value="เธขเธเน€เธฅเธดเธ" />
</label></td>
</tr>
</table>
<?
}
?>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="2" bgcolor="8c0000"></td>
</tr>
</table></td>
</tr>
<tr>
<td><? //include "footer.php"; ?></td>
</tr>
</table>
</body>
</html>
check_data.php
Code (PHP)
<?
session_start();
include "function.php";
include "connectDB.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>-:- ระบบจัดการศูนย์ Trainning ARAGON 101 -:-</title>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?
$strTemp = trim($_POST["upline_code"]);
$Result = select("tb_customer","WHERE cust_code = '".$strTemp."' ");
$chk = num_record("tb_customer","WHERE cust_code = '".$strTemp."' ");
$objResult = mysql_fetch_array($Result);
if($chk != 0)
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_name' type='text' id='upline_name' size='30' maxlength='100' disabled='disabled' value='$objResult[cust_name]' /><strong><span class='alerttxt'>*</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_tel' type='text' id='upline_tel' size='20' maxlength='20' disabled='disabled' value='$objResult[cust_tel]' /></td>";
echo "</tr>";
echo "</table>";
}
else
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "</table>";
}
?>
</body>
</html>
|
|
|
|
|
Date :
2011-08-25 10:13:10 |
By :
turesjung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลอง เปลี่ยนที่ ไฟล์
check_data.php
Code (PHP)
<?
session_start();
include "function.php";
include "connectDB.php";
?>
<?
$strTemp = trim($_POST["upline_code"]);
$Result = select("tb_customer","WHERE cust_code = '".$strTemp."' ");
$chk = num_record("tb_customer","WHERE cust_code = '".$strTemp."' ");
$objResult = mysql_fetch_array($Result);
if($chk != 0)
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_name' type='text' id='upline_name' size='30' maxlength='100' disabled='disabled' value='$objResult[cust_name]' /><strong><span class='alerttxt'>*</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'> <input name='upline_tel' type='text' id='upline_tel' size='20' maxlength='20' disabled='disabled' value='$objResult[cust_tel]' /></td>";
echo "</tr>";
echo "</table>";
}
else
{
echo "<table width='446' border='0' cellspacing='2' cellpadding='0'>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>ชื่อ-สกุล </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "<tr>";
echo " <td height='25' width='136' align='right' bgcolor='#8c0000'><strong><span class='whitetxt'>หมายเลขโทรศัพท์ </span></strong><span class='whitetxt'></span> </td>";
echo " <td align='left' width='306' bgcolor='#FF9966'><strong><span class='alerttxt'> ไม่พบข้อมูล</span></strong></td>";
echo "</tr>";
echo "</table>";
}
?>
|
|
|
|
|
Date :
2011-08-25 11:28:19 |
By :
ไวยวิทย์ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองแล้วครับก็เป็นภาษาต่างดาวอยู่ดี ค่าที่ส่งเข้า-ออกถูกต้องครับ แต่ติดตรงภาษาที่แสดงอย่างเดียวเลย
|
|
|
|
|
Date :
2011-08-25 11:47:49 |
By :
turesjung |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
header ('Content-type: text/html; charset=tis-620');
ลองดูครับ
|
|
|
|
|
Date :
2011-08-25 21:17:05 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมก็เคยเป็น
ก็ทำแบบ คห.3 ถ้าเดาถูก ไฟล์ แสดงผล client เป็น tis-620 หรือ windows-874 ส่วน
ไฟล์แสดงผล sv ไม่ได้ระบุ(มั้ง แต่ผมก็ไม่ได้เซตอะไรนะ เป็น php เพียวๆ)
ว่ากันที่ไฟล์ sv (client ช่างมัน ปล่อยมัน) เมื่อ ajax client ส่งค่ามาให้ไฟล์ sv มันจะเป็น utf-8 (รายละเอียดรอผู้รู้นะว่าทำไม)
เราก็ทำการแปลงด้วยฟังชัน ของ php ดัง คห.3 แนะนำ(ส่วนรายละเอียดของฟังชัน หาอ่านเอานะ) ก็คือแปลงจาก utf-8 เป็น tis win อะไรที่ต้อง
การสำหรับลงฐานข้อมูลหรือไม่ลงก็ว่ากันไป
ทีนี้คือตัวที่จะไปแสดงผลยังไฟล์ client ละทีนี้ เราก็แปลงมันกลับซะ ด้วย ฟังชันเดิมนั่นแหละ จาก tis win ให้เป็น utf ซะ
เท่านี้มันก็จะไม่ต่างด้าวกันอีกต่อไป
ปล.วิธีที่ผมใช้นะ ถ้ามีวิธีดีกว่านี้ บอกกันด้วย
|
|
|
|
|
Date :
2011-11-04 15:19:18 |
By :
diawcpe |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
header ('Content-type: text/html; charset=tis-620');
ได้ผลเลยครับ
|
|
|
|
|
Date :
2012-01-07 18:47:03 |
By :
panoo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|