bakigkgz Posted October 30, 2010 Share Posted October 30, 2010 this code work in google chrome browser but it does not work IE and mozilla firefox browser why? <?php $connect = mysql_pconnect("localhost","root",""); if (!$connect) { die('Veri Tabanı bağlantı hatası: ' . mysql_error()); } mysql_select_db("bony_talep", $connect); mysql_query("SET CHARACTER SET UTF8"); ?> <html> <head> <title>Talep Form</title> <script type="text/javascript"> function sil() { var ele = document.getElementById('text_ekle'); ele.parentNode.removeChild(ele); } function sil1() { var ele1 = document.getElementById('sehir1'); ele1.parentNode.removeChild(ele1); } function bul () { //window.location="talepson.php"; var select_ulke = document.talep_form.ulkeler; var selected_ulke = select_ulke.options[select_ulke.selectedIndex].text; if(selected_ulke=="Turkiye") { sil(); var element = document.createElement("select"); element.type ="text"; element.name ="sehir1"; element.id ="sehir1"; element.size = "1"; document.getElementsByName("talep_form")[0].appendChild(element); //var select_bolge = document.talep_form.ulkeler; var select_il = document.talep_form.sehir1; //var selected_bolge = select_bolge.options[select_bolge.selectedIndex].value; var Akdeniz = new Array("Adana", "Antalya", "Burdur", "Hatay", "Isparta", "Kilis", "Mersin", "Osmaniye"); for(var i=0; i<Akdeniz.length; i++) { select_il.options[select_il.options.length] = new Option(Akdeniz); } } else { sil1(); var element = document.createElement("input"); element.type ="text"; element.name ="text_ekle"; element.id ="text_ekle"; element.size = "20"; document.getElementsByName("talep_form")[0].appendChild(element); } } </script> </head> <body> <form name="talep_form"> <?php //echo ulkeler(); // echo " <select name='ulkeler' id='ulkeler' onchange='bul()'>"; $sql=mysql_query("select * from ulke"); while ($row=mysql_fetch_array($sql)) { $ulke_adi=$row['ulkeadi']; $id=$row['ulkeID']; echo "<option value=$id>$ulke_adi</option>"; } echo "</select>"; echo "<br>"; // $sql_sehir="select * from sehir"; $res_sehir = mysql_query($sql_sehir); $result_sehir = mysql_query($sql_sehir); echo "<select name='sehir1' id='sehir1'>"; while ($row=mysql_fetch_array($res_sehir)) { $sehir_adi=$row['sehiradi']; $id=$row['sehirID']; echo "<option value=$id>$sehir_adi</option>"; } echo "</select>"; ?> <?php function ulkeler() { echo " <select name='ulkeler' id='ulkeler' onchange='bul()'>"; $sql=mysql_query("select * from ulke"); while ($row=mysql_fetch_array($sql)) { $ulke_adi=$row['ulkeadi']; $id=$row['ulkeID']; echo "<option value=$id>$ulke_adi</option>"; } echo "</select>"; echo "<br>"; } function sehirler() { $sql_sehir="select * from sehir"; $res_sehir = mysql_query($sql_sehir); $result_sehir = mysql_query($sql_sehir); echo "<select name='sehir1' id='sehir1'>"; while ($row=mysql_fetch_array($res_sehir)) { $sehir_adi=$row['sehiradi']; $id=$row['sehirID']; echo "<option value=$id>$sehir_adi</option>"; } echo "</select>"; } function text_ekle() { echo "<input type='text' name='text_ekle' id='text_ekle' size='20'>"; } ?> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/217289-baki/ Share on other sites More sharing options...
trq Posted October 31, 2010 Share Posted October 31, 2010 Firstly, when you post a new topic the subject should describe the contents of your post, not your user name. Secondly, you need to actually describe the problem. 'Not working' is NOT enough information. Quote Link to comment https://forums.phpfreaks.com/topic/217289-baki/#findComment-1128541 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.