Guest User

Untitled

a guest
Jan 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. //Selecting Random quotes from database --randomquotes.php
  3. require('dbconnection.php');
  4. // $temp=10;
  5. $sql = "SELECT * FROM db.q order by rand() LIMIT 1";
  6. $res = mysql_query($sql,$con);
  7. while ($res1=mysql_fetch_assoc($res))
  8. {
  9. print "<em>".$res1['quote']."</em>";
  10. }
  11. ?>
  12.  
  13. <div class="class_box_shadow_quote">
  14. <?php
  15. require('randomquotes.php');
  16. ?>
  17. </div>
  18.  
  19. <script>
  20. var $j = jQuery.noConflict();
  21. $j(document).ready(function(){
  22. setInterval(function() {
  23. $j(".class_box_shadow_quote").load('randomquotes.php');
  24. }, 7000);
  25. });
  26. </script>
  27.  
  28. setInterval(function() {
  29. $j.ajax({
  30. url: 'randomquotes.php',
  31. cache: false,
  32. success: function(data) {
  33. $j(".class_box_shadow_quote").html(data);
  34. }
  35. });
  36. }, 7000);
  37.  
  38. $(".class_box_shadow_quote").load('randomquotes.php?s=' + (Math.Random() * 1000000))
Add Comment
Please, Sign In to add comment