Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <HTML>
- <HEAD>
- <TITLE>Video</TITLE>
- </HEAD>
- <BODY BGCOLOR="#000000">
- <img name="foto">
- <?php
- $servername="localhost";
- $username="root";
- $password="";
- $dbname="track_the_ball";
- $conn = new mysqli($servername,$username,$password,$dbname);
- echo '
- <SCRIPT LANGUAGE="JavaScript">
- var Pic = new Array();
- for (var i = 1; i < 127; i++) {';
- $sel="SELECT * FROM user_coordinate";
- $result= $conn->query($sel);
- if ($result->num_rows > 0) {
- while ($row=$result->fetch_assoc()) {
- $x=$row['xaxis'];
- $y=$row['yaxis'];
- $sel_1="SELECT * FROM coordinate where xaxis=$x AND yaxis=$y";
- $result_1= $conn->query($sel_1);
- while ($row=$result_1->fetch_assoc()) {
- if ($result_1->num_rows > 0) {
- $folder="with";
- echo 'Pic[i] = "images/'.$folder.'/"+i+".jpg" ';
- }
- }
- }
- }
- echo '
- }
- //this part in real code is replaced with a PHP script that print image location dinamically
- var t;
- var j = 1;
- var p = Pic.length;
- var preLoad = new Array();
- for (i = 1; i < p; i++) {
- preLoad[i] = new Image();
- preLoad[i].src = Pic[i];
- }
- //all images are loaded on client
- index = 1;
- function update(){
- if (preLoad[index]!= null){
- document.images["foto"].src = preLoad[index].src;
- index++;
- setTimeout(update, 36.5);
- }
- }
- update();
- </script>';
- ?>
- <a href="http://www.ishtech.info/track_the_ball_with_ball/">PLAY AGAIN</a>
- </BODY>
- </HTML>
Add Comment
Please, Sign In to add comment