message.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <html lang="en">
  2. <head>
  3. <meta charset="UTF-8" />
  4. <title>Color Strike Scores</title>
  5. <script type="text/javascript">var switchTo5x=true;</script>
  6. <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
  7. <script type="text/javascript">stLight.options({publisher: "e2135556-d99b-42f9-9a70-81a664ba2ee6", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
  8. <style>
  9. h1{ font-size: 1.9em; margin: 10px 0}
  10. p{ margin: 8px 0}
  11. *{
  12. margin: 0;
  13. padding: 0;
  14. box-sizing: border-box;
  15. -webkit-box-sizing: border-box;
  16. -moz-box-sizing: border-box;
  17. -webkit-font-smoothing: antialiased;
  18. -moz-font-smoothing: antialiased;
  19. -o-font-smoothing: antialiased;
  20. font-smoothing: antialiased;
  21. text-rendering: optimizeLegibility;
  22. }
  23. body{
  24. font: 14px Arial,Tahoma,Helvetica,FreeSans,sans-serif;
  25. text-transform: inherit;
  26. color: #333;
  27. background:#226BB3 url('bg.png');
  28. background-repeat:repeat;
  29. background-position:10px 10px;
  30. width: 100%;
  31. line-height: 18px;
  32. }
  33. .wrap{
  34. width: 700px;
  35. margin: 20px auto auto auto ;
  36. background: white;
  37. border: 2px solid #DBDBDB;
  38. -webkit-border-radius: 10px;
  39. -moz-border-radius: 10px;
  40. border-radius: 10px;
  41. box-shadow: 7px 7px 5px #2B2B2B;
  42. overflow: hidden;
  43. text-align: center;
  44. }
  45. #footer {
  46. text-align: center;
  47. clear: both;
  48. width: 400px;
  49. margin-left:auto;
  50. margin-right:auto;
  51. margin-top: 10px;
  52. }
  53. </style>
  54. </head>
  55. <?php
  56. $mysqli = new mysqli("portfolio.jancokock.me", "csadmin", "aardbei123", "colorstrike");
  57. function safeString($var){
  58. $TEMPSTRING = $var;
  59. $TEMPSTRING = strip_tags($TEMPSTRING);
  60. $TEMPSTRING = htmlspecialchars($TEMPSTRING);
  61. $TEMPSTRING = trim($TEMPSTRING);
  62. return $TEMPSTRING;
  63. }
  64. $id = safeString($_GET['id']);
  65. if (ctype_digit($id)) { #Check if the id is a valid number
  66. if($stmt = $mysqli -> prepare(" SELECT highscore.username, highscore.score, song.title
  67. FROM highscore, song, songinstance
  68. WHERE highscore.id = ?
  69. AND songinstance.id = songinstance
  70. AND songinstance.song = song.id")){
  71. $stmt->bind_param('i', $id);
  72. $stmt -> execute();
  73. $stmt -> bind_result($username, $score, $title);
  74. $stmt -> fetch();
  75. $stmt -> close();
  76. }
  77. }
  78. $img = "images/".$id.".jpeg";
  79. ?>
  80. <body>
  81. <div class="wrap">
  82. <h1>Hoeray, <?php echo $username; ?></h1> <br />
  83. <p>
  84. You have set a incredible score of <span style="font-size:20;"><?php echo $score; ?> points</span> at the song <b>"<?php echo $title; ?>"</b>.
  85. </p>
  86. Here is a suprise for you! <br />
  87. <img src="<?php echo $img; ?>" /> <br />
  88. <br>
  89. Share your score with al your friends:
  90. <span class='st_facebook_large' displayText='Facebook'></span>
  91. <span class='st_twitter_large' displayText='Tweet'></span>
  92. <span class='st_googleplus_large' displayText='Google +'></span>
  93. <span class='st_tumblr_large' displayText='Tumblr'></span>
  94. <span class='st_pinterest_large' displayText='Pinterest'></span>
  95. <span class='st_email_large' displayText='Email'></span>
  96. <div id = "footer">
  97. &copy;The Essteling
  98. </div>
  99. </div>
  100. </body>
  101. </html>