Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Liệt kê bài hát theo album</title>
- <script src="jquery.js"></script>
- <script>
- $(document).ready(function(){
- $("#macasi").change(function(){
- var macasi=$("#macasi").val();
- console.log(macasi);
- $.post("lietkealbum_ajax.php",
- {
- macasi:macasi
- },
- function(data,status){
- if(status=="success")
- {
- $("#iddiv").html(data);
- }
- });
- });
- $('#maalbum').live('change', function() {
- var maalbum=$("#maalbum").val();
- $.post("lietkebaihat_ajax.php",
- {
- maalbum:maalbum
- },
- function(data,status){
- if(status=="success")
- {
- $("#iddiv1").html(data);
- }
- });
- });
- });
- </script>
- </head>
- <body>
- <?php
- include "connect.php";
- $str="select * from casi";
- $rs=mysql_query($str,$conn);
- echo "Tên ca sĩ<br>";
- echo "<select id='macasi'>";
- echo "<option selected>Chọn ca tên ca sĩ</option>";
- while($row=mysql_fetch_row($rs))
- {
- echo "<option value='$row[0]'>".$row[1]."</option>";
- }
- echo "</select>";
- echo "<div id='iddiv'>";
- echo "<br><div id='iddiv1'>";
- ?>
- <br>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement