RE: question about ajax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

 

You are welcome; sharing our knowledge is good way to learn.  keep your questions and suggestion post on forum, you always welcome I will answer mostly.

 

I checked the string one you given. This problem occurs because of Browser. I think you don’t have support for multiple languages. You can enable multiple language support either through Operating system language add-ons support or download Firefox / IE multiple language support.

 

So you can view the Arabic readable. Because I can see the Arabic words (kuran :-) )  styles in my browser. 

 

 

 

Thanks,

Muthukumar Selvarasu,

Project Manager (Web Development),

Webmasters Ltd.

 

 

 

  _____  

From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On Behalf Of Rasha Abdo
Sent: Friday, December 14, 2007 12:45 PM
To: php-objects@xxxxxxxxxxxxxxx
Subject: RE:  question about ajax

 

Hi,
Thank you for helping me,and I am very sorry at the same.
I understand what does u mean.
and this code work more fine than before,but still view arabic character like this (????????)
I suppose it maybe from mysql version or my browser . I don't know.
u can see this pictures i attach it.
I need your advice.
Thank u,sorry for second time.

Muthukumar Selvarasu <muthukumar_se@ <mailto:muthukumar_se%40hotmail.com> hotmail.com> wrote: Hey Rasha Abdo,

its really good experience why this problem for you. I figure out this problem. Actually Arabic is no ASCII characters, so when you pass the no-ascii character it will not parsed by server as it.

so use the below code. Just changed into id instead of course name.

page1.php

<?php

$link=mysql_connect("localhost","root","root123"); 

$selectdb = @mysql_select_db("test");

$query_Rsgood2 = "SELECT DISTINCT course_name, id FROM courses ";

$Rsgood2 = mysql_query($query_Rsgood2) or die(mysql_error());

$row_Rsgood2 = mysql_fetch_assoc($Rsgood2);

?>

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">

<script language="javascript">

//Create a boolean variable to check for a valid Internet Explorer instance.

var xmlhttp = false;

//Check if we are using IE.

try {

//If the Javascript version is greater than 5.

xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {

//If not, then use the older active x object.

try {

//If we are using Internet Explorer.

xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

} catch (E) {

//Else we must be using a non-IE browser.?id=<? //echo 8;?>

xmlhttp = false;

}

}

//If we are using a non-IE browser, create a javascript instance of the object.

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

xmlhttp = new XMLHttpRequest();

}

function srch(id)

{

var objID1="lec";

var url1="lec.php";

url1=url1+'?id='+id;

url1=url1+"&sid="+Math.random();

//document.write(course_Name);

var obj1 = document.getElementById(objID1);

xmlhttp.open("GET",url1);

xmlhttp.onreadystatechange = function() {

if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

obj1.value = xmlhttp.responseText;

}

}

xmlhttp.send(null);

}

</script>

</head>

<body>

<form name="form1" method="post" action="">

<div align="center">

<table width="308" border="0">

<tr>

<td width="95" height="71"><div align="right"></div></td>

<td width="203"><div align="right"></div></td>

</tr>

<tr>

<td height="53"><div align="right">

<select name="course_Name" id="course_Name" onChange=srch(this.value) dir="rtl" lang="ar">

<option>?§?®???§?± ?§?³U… ?§U„?¯Uˆ?±?© ?§U„???±U??¨U??©</option>

<?php 

do { 

?>

<option value="<?php echo $row_Rsgood2['id']?>"><?php echo $row_Rsgood2['course_name']?></option>

<?php

} while ($row_Rsgood2 = mysql_fetch_assoc($Rsgood2));

?> </select>

</div></td>

<td><div align="right">?§?³U… ?§U„?¯Uˆ?±?© ?§U„???¯?±U??¨U??© </div></td>

</tr>

<tr>

<td><div align="right">

<input name="lec" type="text" id="lec">

</div></td>

<td><div align="right">?§?³U… ?§U„U…?­?§?¶?± </div></td>

</tr>

<tr>

<td><div align="right"></div></td>

<td><div align="right"></div></td>

</tr>

</table>

</div>

</form>

</body>

</html>

lec.php

------

<?

$link=mysql_connect("localhost","root","root123"); 

$selectdb = @mysql_select_db("test");

$c_n=$_GET['id'];

$select="select * from courses where id='$c_n'"; 

$collectcourse=mysql_query($select) or die(mysql_error()); 

$row=mysql_fetch_array($collectcourse);

echo $row['lect_name'] ; 

?>

Hope you will enjoy the day with solution.

Thanks,

Muthukumar Selvarasu,

Project Manager (Web Development),

Webmaster Ltd.

_____ 

From: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com [mailto:php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com] On Behalf Of Rasha Abdo
Sent: Friday, December 14, 2007 11:56 AM
To: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com
Subject: RE:  question about ajax

Hi,
I am already use this query in db, but it doesn't work because I entry arabic data like this:

CREATE TABLE `courses` (

`id` int(11) NOT NULL auto_increment,

`course_name` varchar(255) default NULL,

`lect_name` varchar(255) default NULL,

PRIMARY KEY (`id`)

) ;

/*Data for the table `courses` */

insert into `courses` (`id`,`course_ name`,`lect_ name`) values (1,'ط¸â€¦ط¸â€ ط¸â€°','ط¸ظ¾ط¸â€‍ط·آ§ط·آ´' );

insert into `courses` (`id`,`course_ name`,`lect_ name`) values (2,'ط·آ§ط·آ­ط¸â€¦ط·آ¯','ط·آ§ط·آ¬ط·آ§ط¸ئ’ط·آ³' );

insert into `courses` (`id`,`course_ name`,`lect_ name`) values (3,'ط·آ±ط·آ´ط·آ§','ط·آ³ط¸ث†ط¸ظ¹ط·ع¾ط·آ´' );
The problem in arabic data,
If I use english data the code will working fine.
and i am sure for using right password .
what is the problem with arabic data?

thanks. 

Muthukumar Selvarasu <muthukumar_se@ <mailto:muthukumar_se%40hotmail.com> hotmail.com> wrote: Hi

the code you gave me its working fine.

check yourself carefully, you may be using wrong password to connect mysql database. 

I used first page as page1.php

second page as lec.php

here my sql table structure my assumption

CREATE TABLE `courses` (

`id` int(11) NOT NULL auto_increment,

`course_name` varchar(255) default NULL,

`lect_name` varchar(255) default NULL,

PRIMARY KEY (`id`)

) ;

/*Data for the table `courses` */

insert into `courses` (`id`,`course_name`,`lect_name`) values (1,'c1','l1');

insert into `courses` (`id`,`course_name`,`lect_name`) values (2,'c2','l2');

insert into `courses` (`id`,`course_name`,`lect_name`) values (3,'c3','l3');

Thanks,

Muthukumar Selvarasu,

Project Manager (Web Development),

Webmasters Ltd.

_____ 

From: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com [mailto:php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com] On Behalf Of Rasha Abdo
Sent: Friday, December 14, 2007 7:57 AM
To: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com
Subject: RE:  question about ajax

Hi,
Thanks for your response, but i still can't using it in arabic.
I always find problem with arabic. 
Can you see this code.please,
Thanks

the first page:

<?php
$link=mysql_connect("localhost","root","123456789"); 
$selectdb = @mysql_select_db("test");
$query_Rsgood2 = "SELECT DISTINCT course_name FROM courses ";
$Rsgood2 = mysql_query($query_Rsgood2) or die(mysql_error());
$row_Rsgood2 = mysql_fetch_assoc($Rsgood2);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<script language="javascript">
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

} catch (E) {
//Else we must be using a non-IE browser.?id=<? //echo 8;?>
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
function srch(course_Name)
{
var objID1="lec";

var url1="lec.php";
url1=url1+'?course_Name='+course_Name;
url1=url1+"&sid="+Math.random();
//document.write(course_Name);
var obj1 = document.getElementById(objID1);

xmlhttp.open("GET",url1);

xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj1.value = xmlhttp.responseText;

}
}
xmlhttp.send(null);
}

</script>
</head>

<body>
<form name="form1" method="post" action="">
<div align="center">
<table width="308" border="0">
<tr>
<td width="95" height="71"><div align="right"></div></td>
<td width="203"><div align="right"></div></td>
</tr>
<tr>
<td height="53"><div align="right">
<select name="course_Name" id="course_Name" onChange=srch(this.value) dir="rtl" lang="ar">
<option>اختار اسم الد� رة التريبية</option>
<?php 
do { 
?>
<option value="<?php echo $row_Rsgood2['course_name']?>"><?php echo $row_Rsgood2['course_name']?></option>
<?php
} while ($row_Rsgood2 = mysql_fetch_assoc($Rsgood2));
?> </select>
</div></td>
<td><div align="right">اسم الد� رة التدريبية </div></td>
</tr>
<tr>
<td><div align="right">
<input name="lec" type="text" id="lec">
</div></td>
<td><div align="right">اسم المحاضر </div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><div align="right"></div></td>
</tr>
</table>
</div>
</form>

</body>
</html>

the second page :

<?
$link=mysql_connect("localhost","root","123456789"); 
$selectdb = @mysql_select_db("test");
$c_n=$_GET['course_Name'];
$select="select * from courses where course_name='$c_n'"; 
$collectcourse=mysql_query($select) or die(mysql_error()); 
$row=mysql_fetch_array($collectcourse);
echo $row['lect_name'] ; 
?>
Muthukumar Selvarasu <muthukumar_se@ <mailto:muthukumar_se%40hotmail.com> hotmail.com> wrote: Hi

Ajax supports all language, the thing is you going to display Arabic font
that's it

Thanks,

Muthukumar Selvarasu,

Project Manager (Web Development),

Webmasters Ltd.

_____ 

From: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com [mailto:php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com] On
Behalf Of Rasha Abdo
Sent: Friday, December 14, 2007 4:03 AM
To: php-objects@ <mailto:php-objects%40yahoogroups.com> yahoogroups.com
Subject:  question about ajax

is ajax supporting arbic?

---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

---------------------------------
Never miss a thing. Make Yahoo your homepage.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]

 



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux