Advertisement
Guest User

Untitled

a guest
Mar 12th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. <?php
  2. // Print a login-id
  3. mysql_connect("localhost", "root", "") or die(mysql_error());
  4.  
  5. mysql_select_db("db") or die(mysql_error());
  6. {
  7. $username = $_COOKIE['ID_my_site'];
  8.  
  9. $pass = $_COOKIE['Key_my_site'];
  10.  
  11. $check = mysql_query("SELECT * FROM users WHERE username = '$username'")
  12. or die(mysql_error());
  13.  
  14. while($info = mysql_fetch_array( $check ))
  15. {
  16. $targetNo = "1";
  17. if( !empty($_GET) ) {
  18. $targetNo = $_GET["newT"];
  19. }
  20.  
  21. mysql_connect("localhost", "root", "") or die(mysql_error());
  22. mysql_select_db("db") or die(mysql_error());
  23. $data = mysql_query("SELECT * FROM alphabet where id >= $targetNo;")
  24. or die(mysql_error());
  25. ?>
  26.  
  27. <aside style="font-size:larger;font-style:italic;color:green;float:left;width:100px;">
  28. <div style="background:pink;height:710px">
  29. Username: <?php print $username ?>
  30. <br><br><br><br>
  31. Score: <?php print $targetNo-1 ?>
  32. </aside>
  33.  
  34. <aside style="float:left;width:1000px;">
  35. <div style="background:lightblue;height:710px">
  36. <svg onload='Init(evt)'>
  37. <title>Fish Game</title>
  38.  
  39. <SCRIPT LANGUAGE='JavaScript'>
  40. var SVGDocument = null;
  41. var SVGRoot = null;
  42.  
  43. function Init(evt) {
  44. SVGDocument = evt.target.ownerDocument;
  45. SVGRoot = SVGDocument.documentElement;
  46. }
  47.  
  48. function ToggleOpacity(evt, targetId, targNo) {
  49. if( targetId == parseInt(targNo) ) {
  50. newTarget = SVGDocument.getElementById(targetId);
  51. newTarget.setAttributeNS(null, 'opacity', '0');
  52.  
  53. targetId++;
  54. document.location="AtoZ.php?newT=" + targetId;
  55. }
  56. }
  57. </script>
  58.  
  59. <?php
  60. // status
  61. $a= mysql_query("SELECT * FROM alphabet where id = $targetNo;")
  62. or die(mysql_error());
  63. $targetAlphabet = mysql_fetch_array( $a);
  64.  
  65. $target = $targetAlphabet['Alphabet'];
  66. ?>
  67.  
  68. // status
  69. <text x="10"
  70. y="20"
  71. style="font-family:Times,serif;fill:#B40404;font-size:20px"
  72. >Please find the letter: <?php print $target ?></text>
  73.  
  74. //Fish
  75. <?php
  76. static $info;
  77. while ($info = mysql_fetch_array( $data )) {
  78. $id = $info['ID'];
  79. $al = $info['Alphabet'];
  80. ?>
  81. //fish body
  82. <g id='<?php print $id; ?>' onclick='ToggleOpacity(evt, id,"<?php print $targetNo ?>")'>
  83. <circle cx="<?php print $info['body_cx']; ?>"cy="<?php print $info['body_cy']; ?>" r="<?php print $info['body_r']; ?>" stroke="black" stroke-width="1" fill="<?php print $info['body_fill']; ?>" />
  84.  
  85. //tail
  86. <path d="<?php print $info['tail']; ?>" fill="<?php print $info['tail_fill']; ?>" stroke="<?php print $info['tail_stroke']; ?>" stroke-width="1" />
  87.  
  88. //eye
  89. <circle cx="<?php print $info['eye_cx']; ?>" cy="<?php print $info['eye_cy']; ?>" r="<?php print $info['eye_r']; ?>" stroke="black" stroke-width="1" fill="<?php print $info['eye_fill' ];?>" />
  90. <circle cx="<?php print $info['pupil_cx']; ?>" cy="<?php print $info['pupil_cy']; ?>" r="<?php print $info['pupil_r']; ?>" stroke="black" stroke-width="1 " />
  91.  
  92. //'Alphabet'
  93. <text x="<?php print $info['al_x']; ?>" y="<?php print $info['al_y']; ?>" style="font-family:Times,serif;fill:#B40404;font-size:<?php print $info['size']; ?>"><?php print $al; ?></text>
  94.  
  95. <animateMotion
  96. from="<?php print $info['from']; ?>" to="<?php print $info['to']; ?>"
  97. dur=" <?php print $info['duration']; ?>" repeatCount="indefinite" />
  98. </g>
  99. <?php
  100. }
  101. }
  102. ?>
  103. </svg>
  104. </aside>
  105. <?php
  106. }
  107. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement