Guest User

Untitled

a guest
Jul 4th, 2017
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Video</TITLE>
  4. </HEAD>
  5. <BODY BGCOLOR="#000000">
  6. <img name="foto">
  7. <?php
  8. $servername="localhost";
  9. $username="root";
  10. $password="";
  11. $dbname="track_the_ball";
  12. $conn = new mysqli($servername,$username,$password,$dbname);
  13.  
  14. echo '
  15. <SCRIPT LANGUAGE="JavaScript">
  16. var Pic = new Array();
  17. for (var i = 1; i < 127; i++) {';
  18.  
  19. $sel="SELECT * FROM user_coordinate";
  20. $result= $conn->query($sel);
  21. if ($result->num_rows > 0) {
  22. while ($row=$result->fetch_assoc()) {
  23. $x=$row['xaxis'];
  24. $y=$row['yaxis'];
  25. $sel_1="SELECT * FROM coordinate where xaxis=$x AND yaxis=$y";
  26. $result_1= $conn->query($sel_1);
  27.  
  28. while ($row=$result_1->fetch_assoc()) {
  29. if ($result_1->num_rows > 0) {
  30.  
  31. $folder="with";
  32. echo 'Pic[i] = "images/'.$folder.'/"+i+".jpg" ';
  33.  
  34. }
  35. }
  36. }
  37. }
  38.  
  39. echo '
  40. }
  41. //this part in real code is replaced with a PHP script that print image location dinamically
  42. var t;
  43. var j = 1;
  44. var p = Pic.length;
  45. var preLoad = new Array();
  46. for (i = 1; i < p; i++) {
  47. preLoad[i] = new Image();
  48. preLoad[i].src = Pic[i];
  49. }
  50. //all images are loaded on client
  51. index = 1;
  52. function update(){
  53. if (preLoad[index]!= null){
  54. document.images["foto"].src = preLoad[index].src;
  55. index++;
  56. setTimeout(update, 36.5);
  57. }
  58.  
  59. }
  60. update();
  61.  
  62. </script>';
  63.  
  64. ?>
  65.  
  66.  
  67.  
  68. <a href="http://www.ishtech.info/track_the_ball_with_ball/">PLAY AGAIN</a>
  69.  
  70. </BODY>
  71. </HTML>
Add Comment
Please, Sign In to add comment