Re: [Linux-programlama] Ajax - türkçe karakter problemi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Ahmet (corsairsoft@hotmail.com)
Date: Wed 06 Dec 2006 - 13:18:11 GMT


Tabiki,

iconv kütüphanesi mevcut php konfigurasyonunuzda kurulu olmalı

//index.php
<html>
<head>
 <title>Ajax Deneme</title>
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <!--<link href="stil.css" rel="stylesheet" type="text/css" /> -->
 <script language="JavaScript" type="text/javascript">
 var http;
 var browser = navigator.appName;
 Tarayici()

 function Tarayici() {
   var obj;
  try {
    http = new ActiveXObject('Microsoft.XMLHTTP');
  }
  catch(e) {
    try {
   // Gecko tabanl, safari ve de Opera iin
   http = new XMLHttpRequest();
    }
    catch (e) {
   // XMLHttpRequest destegi yoksa
   http = false;
    }
  }
  return http;
 }

 function Goster(sayfa){
  document.getElementById("goster").innerHTML="Ltfen bekleyiniz.. Veriler alnyor.."
  var url=sayfa
  http.open('post', url);
  http.onreadystatechange = Icerik;
  http.send(null);
 }

 function Icerik(){
  if(http.readyState == 4){
    document.getElementById('goster').innerHTML = http.responseText;
   } else {
  }
 }
 </script>
 
 <style type="text/css">
  body{
   font-family:arial,verdana,helvetica;
   font-size:11px;
   color:#333;
  }
  
  a{
   text-decoration:none;
   color:#336699;
   font-size:12px;
   font-weight:bold;
  }
 </style>
</head>
<body>
<br />
<br />
<br />
<br />

<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
 <a href="javascript:Goster('bilgi1.php');">Bilgi 1</a>&nbsp;-&nbsp;
 <a href="javascript:Goster('bilgi2.php');">Bilgi 2</a>
 </td>
  </tr>
</table>
<br>
<br>
<br>
<br>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td id="goster">
    </td>
  </tr>
</table>
</body>
</html>

//bilgi.php
<?php
 $ayar['server'] ='localhost';
 $ayar['kullanici'] ='root';
 $ayar['sifre'] ='sifre';
 $ayar['vt'] ='veritabani';
 $ayar['tablo'] ='deneme';
 $ayar['kacar']=15;
 @mysql_connect($ayar['server'],$ayar['kullanici'],$ayar['sifre']);
 @mysql_select_db($ayar['vt']);
?>
<html>
 <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="stil.css" rel="stylesheet" type="text/css" />
 </head>
</html>
<body>
<form name="form1" method="post" action="">
 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="altbaslik">
   <tr bgcolor="#204E7F">
  <td width="20" height="16" align="center" bgcolor="#FFCC66" >&nbsp;</td>
  <td width="200" align="center" bgcolor="#FFCC66" ><?php echo iconv("ISO-8859-9", "UTF-8", 'rn Grubu'); ?></td>
   </tr>
 <?php
  $sql = mysql_query("SELECT * FROM deneme");
  $toplam = mysql_num_rows($sql);
  $say = 1;
  while ($haber = mysql_fetch_array($sql))
  {
  if ( $say % 2 == 0 ) { echo "<tr bgcolor=#EEEEEE class='incesiyah'>"; }
  else{ echo "<tr bgcolor=#FFFFFF class='incesiyah'>"; }
  echo "<td height=30 align='center'> <input type='checkbox' class'form_buton' name='cek[]' value='".$haber['ID']."'></td> ";
  echo "<td align='center'>".iconv("ISO-8859-9", "UTF-8", $haber['KAYIT'])."</td>";
  $say = $say + 1;
 }
 ?>
 <input type="hidden" name="gizli" value="<? echo $say = $say-1; ?>">
    </table>
   <br>
   <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="incesiyah">
  <tr>
    <td height="3" bgcolor="#CC9900"></td>
  </tr>
  <tr>
    <td><br>
   <input name="ksekle" type="submit" class="form_buton" id="hekle" value="Grup Ekle">
   <br></td>
  </tr>
  <tr>
    <td><br>Toplam :<?php echo $toplam;?> </td>
  </tr>
  </table>
</form>
</body>
</html>

//MySQL veritabanı
CREATE TABLE `deneme` (
  `ID` int(11) unsigned NOT NULL auto_increment,
  `KAYIT` varchar(20) default NULL,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin5;

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.