hi guys..
im trying to do some ajax work here..
search.html
=================
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>äÃÃã ÃÃà ÃáÃ
ÃÃÃÃÃäÃÃ</title>
<script type="text/javascript"src="zxml.
js"></script>
<script type="text/javascript">
function requestCustomerInfo() {
displayCustomerInfo("Searching Stored Surveys....");
var sId = document.getElementById("txtCustomerId").value;
var oXmlHttp = zXmlHttp.createRequest();
oXmlHttp.open("get", "get_search_results.php?id=" + sId, true);
oXmlHttp.onreadystatechange = function () {
if (oXmlHttp.readyState == 4) {
if (oXmlHttp.status == 200) {
displayCustomerInfo(oXmlHttp.responseText);
} else {
displayCustomerInfo("An error occurred: " + oXmlHttp.statusText); //statusText is not always accurate
}
}
};
oXmlHttp.send(null);
}
function displayCustomerInfo(sText) {
var divCustomerInfo = document.getElementById("divCustomerInfo");
divCustomerInfo.innerHTML = sText;
}
</script>
</head>
<body dir="rtl">
<p>ÃÃÃá ãà ÃÃÃà ÃáÃÃà Ãäå:</p>
<p>Ãáãà ÃáÃÃÃ: <input type="text" id="txtCustomerId" value="" dir="rtl" /></p>
<p><input type="button" value=" Ã
ÃÃà ÃáÃÃà " onclick="requestCustomerInfo()" /></p>
<div id="divCustomerInfo"></div>
</body>
</html>
get_search_results.php
===================
<?php
require_once("./include/db_fns.php");
header("Content-Type:text/plain ; charset=windows-1256");
$sID = $_GET["id"];
$sInfo = "";
$conn = db_connect();
//create the SQL query string
$sql = "Select survey_id,survey_topic from survey_topic where survey_topic like '%$sID%'";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$survey_id=$row['survey_id'];
$survey_topic = $row['survey_topic'];
$sInfo = $sInfo . "<a href=\"preview_results.php?sid=$survey_id\">$surve y_topic</a><br>";
}
}
else
{
$sInfo = $sID;#$sql;#"áã äÃà ÃÃà äÃÃÃà áÃÃÃÃ...ÃÃÃì ÃáãÃÃæÃà ãÃà ÃÃÃì..";
}
echo $sInfo;
?>
the problem im facing is...
when im searching for some ARABIC text..the sId (java script variable) has the value of the textbox and when i alert it is shows arabic perfect...but when its sent through the XMLhttp to the php page, the ARABIC text becomes ????? all question marks....i really dunno what's happening...the encoding of the two page is set to the arabic encoding ...
previously i have faced the same issue but it was with MYSQL and i solved it..this time there is no database....
what can be done to solve this problem ??
Regards,
Noor