Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Liệt kê bài hát theo album</title>
  6. <script src="jquery.js"></script>
  7. <script>
  8. $(document).ready(function(){
  9. $("#macasi").change(function(){
  10. var macasi=$("#macasi").val();
  11. console.log(macasi);
  12. $.post("lietkealbum_ajax.php",
  13. {
  14. macasi:macasi
  15. },
  16. function(data,status){
  17. if(status=="success")
  18. {
  19. $("#iddiv").html(data);
  20. }
  21. });
  22. });
  23.  
  24. $('#maalbum').live('change', function() {
  25. var maalbum=$("#maalbum").val();
  26. $.post("lietkebaihat_ajax.php",
  27. {
  28. maalbum:maalbum
  29. },
  30. function(data,status){
  31. if(status=="success")
  32. {
  33. $("#iddiv1").html(data);
  34. }
  35. });
  36. });
  37. });
  38. </script>
  39. </head>
  40. <body>
  41. <?php
  42. include "connect.php";
  43. $str="select * from casi";
  44. $rs=mysql_query($str,$conn);
  45. echo "Tên ca sĩ<br>";
  46. echo "<select id='macasi'>";
  47. echo "<option selected>Chọn ca tên ca sĩ</option>";
  48. while($row=mysql_fetch_row($rs))
  49. {
  50. echo "<option value='$row[0]'>".$row[1]."</option>";
  51. }
  52. echo "</select>";
  53. echo "<div id='iddiv'>";
  54. echo "<br><div id='iddiv1'>";
  55. ?>
  56. <br>
  57. </body>
  58. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement