RE: question about ajax

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

 



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@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On Behalf Of Rasha Abdo
Sent: Friday, December 14, 2007 7:57 AM
To: php-objects@xxxxxxxxxxxxxxx
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]


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

  Powered by Linux