Nuri hocam;

function telmud()
{
   xmlHttp=ajax();
   if (xmlHttp==null)
   {
    alert ('Tarayiciniz Ajax Desteklemiyor!');
    return;
    }

 var dd=document.getElementById('ilisim').value;
 var basliktel = document.getElementById('telmudisim').value;
 var urltel='telmud_bul.php';
    var sctel ='telmudisim='+basliktel+'&ilisim'=+dd;
    xmlHttp.open('POST', urltel, true);
    xmlHttp.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00
GMT');

xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;
charset=UTF-8');
    xmlHttp.setRequestHeader('Content-length', sctel.length);
    xmlHttp.setRequestHeader('Connection', 'close');
    xmlHttp.onreadystatechange=Guncelletel;
    xmlHttp.send(sctel);

}

ile yapıyorum faat bu sefer ileçlerde gelmiyor :) ya da ben  var
dd=document.getElementById('ilisim').value; bunu yanlış yerde kullandım.


2009/1/22 Nuri Akman <[email protected]>

> Merhaba,
>
> il ismini JS içinde şu komutla almalısınız:
> document.getElementById('ilisim').value
>
>
> onuRRR yazmış:
>
> nuri hocam,
>  vv.php den il ismini ilce_bul.php ye post ediyorum bulduğum ilçeyi de
> tel_bul.php ye post ediyorum fakat il ismini tel_bul.php ye gönderemiyorum.
> aşağıda çalışacak sorgu için il ismini nasıl gönderirim?)
>
> tel_bul.php deki sorgu:
> $telmud_sorgu="select tel from telefonlistesi where il='$ilupd' AND
> ilce='$ilce'";
>
>
>
>
> 2009/1/22 Nuri Akman <[email protected]>
>
>>
>> Mesajınız şu anlama mı geliyor acaba: İL seçildiğinde hem İLÇELER gelmeli,
>> hem de TELEFONLAR gelmeli.
>>
>> Eğer öyle ise, aşağıdaki işlemi bir daha tekrarlamalı ve telefonlar için
>> yeni bir url oluşturarak peşpeşe çalışmasını sağlamalısınız. Session gibi
>> konulara girmeye gerek yok.
>>
>> Ayrıca, AJAX çağrılarında ben POST metodu yerine GET metodunu kullanmayı
>> tercih ediyorum. Bu konuda listedeki arkadaşlar ne der bilemiyorum?
>>
>> Selamlar,
>> Nuri AKMAN
>>
>> onuRRR yazmış:
>>
>> Nuri Hocam çok teşekkürler, dedğiniz gibi kodu değiştirince çalıştı. Fakat
>> küçük bir problemim kaldı:
>> il ismini vv.php den ilce_bul.php ye göndererek  ilçelerini seçiyorum ve
>> bu ilçelerinin bilgilerini listelemek için tel_bul.php yazdım. buraya il
>> ismini göndermek için ilce_bul.php de session kullandım ama çalışmadı. ilk
>> sayfa olan vv.php den ilce_bul.php ye ili gönderirken kullandığım
>>
>>     var baslik = document.getElementById('ilisim').value;
>>     var url='ilce_bul.php';
>>     var sc ='ilisim='+baslik;
>>     xmlHttp.open('POST', url, true);
>>     xmlHttp.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000
>> 00:00:00 GMT');
>>
>> xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;
>> charset=UTF-8');
>>     xmlHttp.setRequestHeader('Content-length', sc.length);
>>     xmlHttp.setRequestHeader('Connection', 'close');
>>     xmlHttp.onreadystatechange=Guncelle;
>>     xmlHttp.send(sc);
>>
>> koda ek olarak tel_bul.php ye de il ismini gönderemez miyim? tekrar
>> teşekkür ederim.
>>
>>
>>
>>
>>
>>
>> 2009/1/22 Nuri Akman <[email protected]>
>>
>>> Merhaba,
>>>
>>> Ajax, aynı sayfadan GET/POST yapmaksızın bilgiye ulaşmak olduğuna göre,
>>> bu konudaki scriptleriniz ilk açılan dosyanızda yer almalıdır.
>>>
>>> Selamlar...
>>>
>>>
>>> onuRRR yazmış:
>>>
>>> Hocam güzel dedin de peki bunları da silersem ilceyi nasıl secip onla
>>> ilgili alanları basacak drop-down a göndericem?
>>>
>>> 2009/1/22 Nuri Akman <[email protected]>
>>>
>>>> Merhaba,
>>>>
>>>> ilce_bul.php: bu dosyada SADECE şu TAG kalsın. Önündekileri ve
>>>> ardındakileri silin:<select name="ilceisim" onChange="ilce();">
>>>>
>>>> Önceki mesajda bunu demiştim. Gördüğüm kadarıyla siz JS fonksiyonlarını
>>>> bırakmışsın. <select name="ilceisim" onChange="ilce();"> satırının 
>>>> üstündeki
>>>> HERŞEYİ silin.
>>>>
>>>> Selamlar,
>>>> Nuri AKMAN
>>>>
>>>>
>>>> onuRRR yazmış:
>>>>
>>>>  Nuri Hocam dediğiniz gibi sayfadaki tagları kaldırdığımda kırmıız
>>>> renkli sonucu alıyorum..
>>>>
>>>> function ilce()
>>>> {
>>>>    xmlHttp=ajax();
>>>>    if (xmlHttp==null)
>>>>    {
>>>>     alert ('Tarayiciniz Ajax Desteklemiyor!');
>>>>     return;
>>>>     }
>>>>     var yenibaslik = document.getElementById('ilceisim').value;
>>>>
>>>>     var yeniurl='tel_bul.php';
>>>>     var yenisc ='ilceisim='+yenibaslik;
>>>>     xmlHttp.open('POST', yeniurl, true);
>>>>     xmlHttp.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000
>>>> 00:00:00 GMT');
>>>>
>>>> xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;
>>>> charset=UTF-8');
>>>>     xmlHttp.setRequestHeader('Content-length', yenisc.length);
>>>>     xmlHttp.setRequestHeader('Connection', 'close');
>>>>     xmlHttp.onreadystatechange=yeniGuncelle;
>>>>     xmlHttp.send(yenisc);
>>>>
>>>> }
>>>>
>>>> function yeniGuncelle()
>>>> {
>>>>     if (xmlHttp.readyState==4)
>>>>     {
>>>>
>>>> document.getElementById('mudalan').innerHTML=xmlHttp.responseText;
>>>>     }
>>>> }
>>>>
>>>>
>>>> function ajax()
>>>> {
>>>>     var xmlHttp=null;
>>>>     try
>>>>     {
>>>>         // Firefox, Opera 8.0+, Safari
>>>>         xmlHttp=new XMLHttpRequest();
>>>>     }
>>>>     catch (e)
>>>>     {
>>>>         // Internet Explorer
>>>>         try
>>>>         {
>>>>             xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
>>>>         }
>>>>         catch (e)
>>>>         {
>>>>             xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
>>>>         }
>>>>     }
>>>>     return xmlHttp;
>>>> }
>>>>
>>>> <select name="ilceisim" onChange="ilce();">
>>>> <?php
>>>> $il = addslashes($_POST['ilisim']);
>>>> mysql_connect ("localhost","root","pass");
>>>> mysql_select_db ("bt") or die ("bt ye baglanamadın");
>>>> mysql_query ("set names utf8");
>>>> $ilce_bul="select ilce from telefonlistesi where il='$il' group by
>>>> ilce";
>>>> $ilce_sorgu = mysql_query($ilce_bul);
>>>> while ($ilce_liste=mysql_fetch_assoc($ilce_sorgu))
>>>> {
>>>> ?>
>>>> <? echo "$ilce_liste[ilce]";?> <? echo "$ilce_liste[ilce]"; ?>
>>>> <?
>>>> }
>>>> ?>
>>>>
>>>> sayfanın çıktısı
>>>>
>>>>
>>>>  function ilce() { xmlHttp=ajax(); if (xmlHttp==null) { alert
>>>> ('Tarayiciniz Ajax Desteklemiyor!'); return; } var yenibaslik =
>>>> document.getElementById('ilceisim').value; var yeniurl='telmud_bul.php'; 
>>>> var
>>>> yenisc ='ilceisim='+yenibaslik; xmlHttp.open('POST', yeniurl, true);
>>>> xmlHttp.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00
>>>> GMT');
>>>> xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;
>>>> charset=UTF-8'); xmlHttp.setRequestHeader('Content-length', yenisc.length);
>>>> xmlHttp.setRequestHeader('Connection', 'close');
>>>> xmlHttp.onreadystatechange=yeniGuncelle; xmlHttp.send(yenisc); } function
>>>> yeniGuncelle() { if (xmlHttp.readyState==4) {
>>>> document.getElementById('mudalan').innerHTML=xmlHttp.responseText; } }
>>>> function ajax() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari
>>>> xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try {
>>>> xmlHttp=new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { xmlHttp=new
>>>> ActiveXObject('Microsoft.XMLHTTP'); } } return xmlHttp; }
>>>>
>>>> --
>>>> antiCobol..
>>>>
>>>>
>>>>
>>>> ------------------------------
>>>>
>>>> _______________________________________________
>>>> Linux-programlama mailing 
>>>> [email protected]http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Linux-programlama mailing list
>>>> [email protected]
>>>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>>
>>>>
>>>
>>>
>>> --
>>> antiCobol..
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> Linux-programlama mailing 
>>> [email protected]http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>
>>>
>>>
>>> _______________________________________________
>>> Linux-programlama mailing list
>>> [email protected]
>>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>>
>>>
>>
>>
>> --
>> antiCobol..
>>
>> ------------------------------
>>
>> _______________________________________________
>> Linux-programlama mailing 
>> [email protected]http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>
>>
>>
>> _______________________________________________
>> Linux-programlama mailing list
>> [email protected]
>> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>>
>>
>
>
> --
> antiCobol..
>
> ------------------------------
>
> _______________________________________________
> Linux-programlama mailing 
> [email protected]http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>
>
> _______________________________________________
> Linux-programlama mailing list
> [email protected]
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>


-- 
antiCobol..
_______________________________________________
Linux-programlama mailing list
[email protected]
http://liste.linux.org.tr/mailman/listinfo/linux-programlama

Cevap