Hi All, I have code that dynamically retrieves data with jquery AJAX. when i want to insert data into database via PHP $_POST method it cannot grab select tag (option) value in Mozilla and Chrome. But it works perfectly in IE.
Below is my code.
Thank you for attentionPHP Code:
<?php
if($_GET['func'] == "drop_1" && isset($_GET['func'])) {
drop_1($_GET['drop_var']);
}
function drop_1($drop_var)
{
include_once('db.php');
$tablet='table'.$drop_var;
$active='active';
$result = mysql_query("SELECT * FROM $tablet where mid='$drop_var' AND act='$active'") or die(mysql_error());
echo '<div class="styled-select">';
echo '<select name="region"><option value="bir" disabled="disabled" selected="selected">Secin...</option>';
while($drop_2 = mysql_fetch_array( $result ))
{
echo '<option value="'.$drop_2['id'].'">'.$drop_2['name'].$drop_2['id'].'</option>';
}
echo '</select>';
echo '</div>';
}
?>
submenu.php
PHP Code:
<?php
if($_POST){ foreach($_POST as $key=>$value){ $$key=$value;} }
if(isset($_POST['addmenu'])){
if($drop_1!="bir" && $_POST['region']!="bir"){
$values="values('', '$secim', '$drop_1', '".$_POST['region']."', '$menu')";
$nactive='nactive';
$table='table'.$drop_1;
$func->seher('submenular', $values);
mysql_query("UPDATE $table SET act='".$nactive."' where id='".$_POST['region']."'");
Header("Location: index.php?do=addsubmenu");
}
}
?>


Reply With Quote
Bookmarks