Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/217289-baki/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.