<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<?php
include 'mheader.php';
$haftalist=$db->query("SELECT * FROM haftalar")->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="container">
<!--Main content-->
<div class="title-bg">
<div class="title">Hafta Seçiniz</div>
</div>
<form>
<center> <select id ="hafta">
<option value="0">Hafta Şeçiniz</option>
<?php
foreach ($haftalist as $key => $value) {
echo '<option value="'.$value['hafta_id'].'">'.$value['hafta_adi'].'</option>';
}
?>
</select>
</script><script>$(document).ready(function(){
$("#gunler").change(function(){
$("#dersporg").show();
$.ajax({
type: 'POST',
data: 'secili='+$(this).find(":selected").val(),
success: function(data){
$("div").html(data);
}
});
});
});
</script>
</head>
<body>
<select id="gunler">
<option value="0">Gün Seçiniz</option>
<option value="pazartesidersprogrami.php">Pazartesi</option>
<option value="salidersprogrami.php">Salı</option>
<option value="carsambadersprogrami.php">Çarşamba</option>
<option value="persembedersprogrami.php">Perşembe</option>
<option value="cumadersprogrami.php">Cuma</option>
</select>
</center>
</form>
<p class="ct">
<table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
Ders Programının Yüklenmesini İstediğiniz Haftayı Seçiniz.
<center>
<table id=dersporg>
<script type="text/javascript">
$(document).ready(function(){
$("#dersporg").hide();
$("#gunler").hide();
$("#hafta").change(function(){
$("#gunler").show();
$("#dersporg").hide();
var haftaid = $(this).val();
$.ajax({
type:"POST",
url:"dersprogrami.php",
data:{"hafta":haftaid},
success:function(e)
{
$("#dersporg").show();
$("#dersporg").html(e);
}
});
})
});
</script>
</table>
</center>
</table>
</p>
</div>
<?php
include 'mfooter.php';
?>şeklinde bir sayfam var bu sayfada ilk olarak haftaları listeliyorum. Ancak yapmak istediğim haftaları listeledikten sonra açılan günler sekmesinden seçeceğim gün ile tablonun olduğu sayfayı ilişkilendirmek yani
url:"dersprogrami.php", yerine günler tablosunda yazan value değerinde yazılı olan sayfayı çağırsın
Yardımcı olabilecek birileri varmı acaba