Advertisement
Guest User

Untitled

a guest
Jul 7th, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.54 KB | None | 0 0
  1. <!--<?php include('database.php'); ?>-->
  2. <!DOCTYPE html>
  3.  
  4. <html>
  5. <head>
  6. <meta charset="utf-8">
  7. <title>Teh Games Questionaire</title>
  8. </head>
  9.  
  10. <style>
  11. body {background-color:lightgrey;}
  12. </style>
  13.  
  14. <body>
  15.  
  16. <h1 style="color:blue;">This is a Blue Heading</h1>
  17.  
  18. <form method="post">
  19. <fieldset>
  20. <?php
  21. $host='cyberfyre.com.mysql';
  22. $user='cyberfyre_com';
  23. $password='SEt8iLhh';
  24. $databaseName='cyberfyre_com';
  25.  
  26. $conn = mysqli_connect($host, $user, $password, $databaseName);
  27. if ($conn->connect_error)
  28. {
  29. die("Connection failed: " . $conn->connect_error);
  30. }
  31.  
  32. echo "Connected successfully\r\n";
  33.  
  34.  
  35.  
  36. ?>
  37. </fieldset>
  38. </form>
  39.  
  40. <form method="post">
  41. <fieldset>
  42.  
  43. What is your name<br>
  44.  
  45. Name: <input type="text" name="Name"/><br><br>
  46.  
  47. What is your email?<br>
  48.  
  49. Email: <input type="text" name="Email"/><br><br>
  50.  
  51. What age range do you belong to?<br>
  52.  
  53. <input type="radio" name="Age" value="Rating 3s"/> <7.<br>
  54. <input type="radio" name="Age" value="Upto Rating 7s"/> 7-11.<br>
  55. <input type="radio" name="Age" value="Upto Rating 12s"/> 12-15.<br>
  56. <input type="radio" name="Age" value="Upto Rating 16s"/> 16-17.<br>
  57. <input type="radio" name="Age" value="Rating 18s"/> 18+.<br><br>
  58.  
  59. What is your favourite video-game genre?<br>
  60. <input type="radio" name="FavGenre" value="RPG"/> Role Playing Game.<br>
  61. <input type="radio" name="FavGenre" value="Action"/> Action.<br>
  62. <input type="radio" name="FavGenre" value="MMORPG"/> Massive Multiplayer Online Role Playing Game.<br>
  63. <input type="radio" name="FavGenre" value="Strategy"/> Strategy.<br>
  64. <input type="radio" name="FavGenre" value="Simulation"/> Simulation.<br>
  65. <input type="radio" name="FavGenre" value="Adventure"/> Adventure.<br>
  66. <input type="radio" name="FavGenre" value="Sports"/> Sports.<br>
  67. <input type="radio" name="FavGenre" value="Action-Adventure"/> Action-Adventure.<br><br>
  68.  
  69. What device do you usually play videogames on?<br>
  70. <input type="radio" name="DeviceQ" value="PC"/> PC.<br>
  71. <input type="radio" name="DeviceQ" value="PS4"/> Playstation 4.<br>
  72. <input type="radio" name="DeviceQ" value="XBOXONE"/> Xbox One.<br>
  73. <input type="radio" name="DeviceQ" value="Wii U"/> Nintendo Wii U.<br>
  74. <input type="radio" name="DeviceQ" value="3DS"/> Nintendo 3DS.<br>
  75. <input type="radio" name="DeviceQ" value="Vita"/> Playstation Vita<br><br>
  76.  
  77. Which do you enjoy more: Single Player or Multiplayer?<br>
  78.  
  79. <input type="radio" name="SingOrMulti" value="Single-Player"/> Single-Player.<br>
  80. <input type="radio" name="SingOrMulti" value="Multi-Player"/> Multi-Player.<br><br>
  81.  
  82. If you play multiplayer games, do you prefer local or online multiplayer?<br>
  83.  
  84. <input type="radio" name="locOrOnline" value="Online"/> Online.<br>
  85. <input type="radio" name="locOrOnline" value="Local"/> Local.<br><br>
  86.  
  87. Do you prefer open world games or ones where the path is chosen for you?<br>
  88.  
  89. <input type="radio" name="OpenWQ" value="open"/> Open World.<br>
  90. <input type="radio" name="OpenWQ" value="pathed"/> Path is chosen for you.<br>
  91. <input type="radio" name="OpenWQ" value="notsure"/> No Preference.<br><br>
  92.  
  93. Do you prefer a game that reacts to your actions or one that is heavily linear?<br>
  94.  
  95. <input type="radio" name="actionorLinear" value="yes"/> Reacts to my actions.<br>
  96. <input type="radio" name="actionorLinear" value="no"/> One that is linear.<br>
  97. <input type="radio" name="actionorLinear" value="same"/> No Preference.<br><br>
  98.  
  99. Do you prefer simple games or ones with a challenge?<br>
  100.  
  101. <input type="radio" name="challengeQ" value="Simple"/> Simple.<br>
  102. <input type="radio" name="challengeQ" value="Challenging"/> Challenging.<br><br>
  103.  
  104. How often do you spend playing games in each sitting?<br>
  105.  
  106. <input type="radio" name="gameplayTimeQ" value="<1 hr"/> <1 hr.<br>
  107. <input type="radio" name="gameplayTimeQ" value="1-2 hrs"/> 1-2 hrs.<br>
  108. <input type="radio" name="gameplayTimeQ" value="2-3 hrs"/> 2-3 hrs.<br>
  109. <input type="radio" name="gameplayTimeQ" value="3-5 hrs"/> 3-5 hrs.<br>
  110. <input type="radio" name="gameplayTimeQ" value="5+ hrs"/> 5+ hrs.<br><br>
  111.  
  112. What is more important to you gameplay or graphics?<br>
  113.  
  114. <input type="radio" name="JoshQ1" value="yes"/> Gameplay.<br>
  115. <input type="radio" name="JoshQ1" value="no"/> Graphics.<br><br>
  116.  
  117. Do you prefer playing independent games or AAA titles?<br>
  118.  
  119. <input type="radio" name="JoshQ2" value="yes"/> Independant.<br>
  120. <input type="radio" name="JoshQ2" value="no"/> AAA.<br><br>
  121.  
  122. Do you enjoy realistic simulation games or more fictional ones?<br>
  123.  
  124. <input type="radio" name="JoshQ3" value="yes"/> Simulation.<br>
  125. <input type="radio" name="JoshQ3" value="no"/> Fictional.<br><br>
  126.  
  127. Do you prefer first person or third person in game?<br>
  128.  
  129. <input type="radio" name="JoshQ4" value="yes"/> First Person.<br>
  130. <input type="radio" name="JoshQ4" value="no"/> Third Person.<br><br>
  131.  
  132. Have you ever modded a game, or seen a modded game(e.g. Skyrim, G-Mod)?<br>
  133.  
  134. <input type="radio" name="mod1" value="yes"/> Yes.<br>
  135. <input type="radio" name="mod1" value="no"/> No.<br><br>
  136.  
  137. Do you think modded games are good enough to buy a pc over console?<br>
  138.  
  139. <input type="radio" name="mod2" value="yes"/> Yes.<br>
  140. <input type="radio" name="mod2" value="no"/> No.<br><br>
  141.  
  142. Do you like “competetive games” ? e.g. DotA, CS:GO, Starcraft<br>
  143.  
  144. <input type="radio" name="comp1" value="yes"/> Yes.<br>
  145. <input type="radio" name="comp1" value="no"/> No.<br><br>
  146.  
  147. Have Cheaters/Hackers ever put you off playing game?<br>
  148.  
  149. <input type="radio" name="cheatersQ" value="yes"/> Yes.<br>
  150. <input type="radio" name="cheatersQ" value="no"/> No.<br><br>
  151.  
  152. How many hours do you play games over the course of a week?<br>
  153. <input type="radio" name="WkTime" value="60+"/> 60+ hours a week.<br>
  154. <input type="radio" name="WkTime" value="40-59"/> 40-59 hours a week.<br>
  155. <input type="radio" name="WkTime" value="30-39"/> 30-39 hours a week.<br>
  156. <input type="radio" name="WkTime" value="20-29"/> 20-29 hours a week.<br>
  157. <input type="radio" name="WkTime" value="15-19"/> 15-19 hours a week.<br>
  158. <input type="radio" name="WkTime" value="10-14"/> 10-14 hours a week.<br>
  159. <input type="radio" name="WkTime" value="5-9"/> 5-9 hours a week.<br>
  160. <input type="radio" name="WkTime" value="Less than 4"/> Less than 4 hours a week.<br><br>
  161.  
  162. Do you have any interest in purchasing DLC (Downloadable Content)?<br>
  163. <input type="radio" name="DLCInterest" value="Very Interested"/> Very Interested.<br>
  164. <input type="radio" name="DLCInterest" value="Slightly Interested"/> Slightly Interested.<br>
  165. <input type="radio" name="DLCInterest" value="disinterested"/> Disinterested.<br>
  166. <input type="radio" name="DLCInterest" value="Slightly Interested"/> Very disinterested.<br>
  167. <input type="radio" name="DLCInterest" value="Depends"/> Depends on game.<br><br>
  168.  
  169. Which platforms do you purchase most games from?<br>
  170. <input type="radio" name="GamePlatform" value="Retail"/> Retail stores such as Game.<br>
  171. <input type="radio" name="GamePlatform" value="Online physical"/> Physical Copies from online retailers.<br>
  172. <input type="radio" name="GamePlatform" value="online"/> Online reatailers such as Steam or Green Man Gaming that provide digital copies.<br>
  173. <input type="radio" name="GamePlatform" value="Developer"/> Purchase games straight from the developer.<br>
  174. <input type="radio" name="GamePlatform" value="Console marketplace"/> Appropriate console marketplace, such as the Xbox live marketplace .<br>
  175. <input type="radio" name="GamePlatform" value="second hand"/> from pre-owned sources such as friends or ebay.<br><br>
  176.  
  177. Would you be willing to pay a small subscription fee to play a game?<br>
  178. <input type="radio" name="Subscription" value="Yes"/> Yes.<br>
  179. <input type="radio" name="Subscription" value="No"/> No.<br><br>
  180.  
  181. Would you ever consider changing console or device?<br>
  182. <input type="radio" name="changeQ" value="Yes"/> Yes.<br>
  183. <input type="radio" name="changeQ" value="No"/> No.<br><br>
  184.  
  185. Do reviews influence your game purchases?<br>
  186. <input type="radio" name="reviewQ" value="Yes"> Yes.<br>
  187. <input type="radio" name="reviewQ" value="No"> No.<br><br>
  188.  
  189. </form>
  190.  
  191. <input type="submit" name="submit" value="Submit"/><br>
  192.  
  193. </fieldset>
  194. </form>
  195.  
  196. <?php
  197. if (isset($_POST['submit']))
  198. {
  199. if (mysqli_ping($conn))
  200. {
  201. echo "Pinged Successfully | ";
  202. }
  203. else
  204. {
  205. echo "Error: ". mysqli_error($conn);
  206. die();
  207. }
  208. if(empty($_POST['Name']) and empty($_POST['Email']) and empty($_POST['Age']) and empty($_POST['FavGenre']) and empty($_POST['DeviceQ']) and empty($_POST['SingOrMulti']) and empty($_POST['locOrOnline']) and
  209. empty($_POST['OpenWQ']) and empty($_POST['actionorLinear']) and empty($_POST['challengeQ']) and empty($_POST['gameplayTimeQ']) and
  210. empty($_POST['JoshQ1']) and empty($_POST['JoshQ2']) and empty($_POST['JoshQ3']) and empty($_POST['JoshQ4']) and
  211. empty($_POST['mod1']) and empty($_POST['mod2']) and empty($_POST['comp1']) and empty($_POST['cheatersQ']) and
  212. empty($_POST['WkTime']) and empty($_POST['DLCInterest']) and empty($_POST['GamePlatform']) and empty($_POST['Subscription']) and empty($_POST['changeQ']) and empty($_POST['reviewQ']))
  213. echo "You have missed questions"; // Displaying Selected Value
  214. else
  215. {
  216. $_Name = $_POST["Name"];
  217. $_Email = $_POST["Email"];
  218. $_Age = $_POST['Age'];
  219. $_FavGenre = $_POST['FavGenre'];
  220. $_DeviceQ = $_POST['DeviceQ'];
  221. $_SingOrMulti = $_POST['SingOrMulti'];
  222. $_locOrOnline = $_POST['locOrOnline'];
  223. $_OpenWQ = $_POST['OpenWQ'];
  224. $_actionorLinear = $_POST['actionorLinear'];
  225. $_challengeQ = $_POST['challengeQ'];
  226. $_gameplayTimeQ = $_POST['gameplayTimeQ'];
  227. $_JoshQ1 = $_POST['JoshQ1'];
  228. $_JoshQ2 = $_POST['JoshQ2'];
  229. $_JoshQ3 = $_POST['JoshQ3'];
  230. $_JoshQ4 = $_POST['JoshQ4'];
  231. $_mod1 = $_POST['mod1'];
  232. $_mod2 = $_POST['mod2'];
  233. $_comp1 = $_POST['comp1'];
  234. $_cheatersQ = $_POST['cheatersQ'];
  235. $_WkTime = $_POST['WkTime'];
  236. $_DLCInterest = $_POST['DLCInterest'];
  237. $_GamePlatform = $_POST['GamePlatform'];
  238. $_Subscription = $_POST['Subscription'];
  239. $_changeQ = $_POST['changeQ'];
  240. $_reviewQ = $_POST['reviewQ'];
  241.  
  242. $sql = "INSERT INTO Responses (Name,Email,Age,FavGenre,DeviceQ,SingOrMulti,locOrOnline,OpenWQ,actionorLinear,challengeQ,gameplayTimeQ,JoshQ1,JoshQ2,JoshQ3,JoshQ4,
  243. mod1,mod2,comp1,cheatersQ,WkTime,DLCInterest,GamePlatform,Subscription,changeQ,reviewQ) VALUES ('$_Name','$_Email','$_Age','$_FavGenre','$_DeviceQ',
  244. '$_SingOrMulti','$_locOrOnline','$_OpenWQ','$_actionorLinear','$_challengeQ','$_gameplayTimeQ','$_JoshQ1','$_JoshQ2','$_JoshQ3',
  245. '$_JoshQ4','$_mod1','$_mod2','$_comp1','$_cheatersQ','$_WkTime','$_DLCInterest','$_GamePlatform','$_Subscription','$_changeQ', '$_reviewQ')";
  246.  
  247. //$sql = "INSERT INTO Responses (Name,Email) VALUES ('$_Name','$_Email')";
  248.  
  249. if (mysqli_query($conn, $sql))
  250. {
  251. echo "New record created successfully";
  252. }
  253. else
  254. {
  255. echo "Error: " . $sql . "\n" . $conn->error;
  256. }
  257.  
  258. $sqlGetAge = "SELECT Name, Age FROM Responses WHERE Email = '$_Email'";
  259. $result = mysqli_query($conn, $sqlGetAge) or die($sqlGetAge.mysql_error());
  260. if (mysqli_num_rows($result) > 0) {
  261. // output data of each row
  262. while($row = mysqli_fetch_assoc($result))
  263. {
  264. echo " name: " . $row["Name"]. " - age: " . $row["Age"];
  265. if ($row["Age"] = 'Rating 3s')
  266. {
  267. //echo " name: " . $row["Name"]. " - age: " . $row["Age"];
  268. mail($_Email,'Product Suggestions For '. $row["Name"], "Hello, " . $row["Name"].
  269. " | Age: " . $row["Age"]. " | Thankyou for visiting Teh Games and completing the survey,
  270. here are the some games that we think you might like: FlintSmash! The game is set on
  271. the fictional Suthon Island. It is said to hold the power to protect the world from harm,
  272. which it was protected by a large palm tree and watched over by the nature spirits in the island.
  273. Before the game, the antagonist, Omminus, takes over the island in order to rule the world. As a result,
  274. the palm tree begins to wither and the princess becomes ill. The leader of the nature spirits recalls an
  275. old legend about a hero using sacred pearls to restore the peace. He finds the treasure chest where the
  276. hero, Zip, resides. Zip, and a friend from the neighboring Eesturn Island, Pip, set out to retrieve the
  277. pearls and defeat Omminus.");
  278. }
  279. elseif ($row["Age"] = 'Upto Rating 7s')
  280. {
  281. //echo "name: " . $row["Name"]. " - age: " . $row["Age"];
  282. mail($_Email,'Product Suggestions For '. $row["Name"], "Hello, " . $row["Name"].
  283. " | Age: " . $row["Age"]. " | Thankyou for visiting Teh Games and completing the survey,
  284. here are the some games that we think you might like: Lego Harry Potter Series!
  285. Lego Harry Potter is a Lego theme based on the films of the Harry Potter series.
  286. Lego models of important scenes, vehicles and characters were made for the first
  287. six films and all the books released. The first sets appeared in 2001, to coincide
  288. with the release of the first film Harry Potter and the Philosopher's Stone (Harry
  289. Potter and the Sorcerer's Stone in the United States). Subsequent sets were released
  290. alongside the new films, up until Harry Potter and the Order of the Phoenix.
  291. The line then went dormant for three years..");
  292. }
  293. elseif ($row["Age"] = 'Upto Rating 12s')
  294. {
  295. //echo "name: " . $row["Name"]. " - age: " . $row["Age"];
  296. mail($_Email,'Product Suggestions For '. $row["Name"], "Hello, " . $row["Name"].
  297. " | Age: " . $row["Age"]. " | Thankyou for visiting Teh Games and completing the survey,
  298. here are the some games that we think you might like: Super Smash Bro Brawl! Following its predecessors,
  299. Brawl uses a battle system unlike that of typical fighting games. Players can
  300. choose from a large selection of characters, each attempting to knock their
  301. opponents off the screen as they fight on various stages. The characters in
  302. Brawl include most of the same ones as the predecessors, such as the well-known
  303. Mario and Pikachu. Instead of using traditional health bars that start at a maximum
  304. value and lose value, Brawl characters start the game with 0%; the value rises as
  305. they take damage and may rise over 100% to a maximum of 999%. As a character's
  306. percentage increases, the character flies further back when hit. When a character
  307. is knocked beyond a stage's boundary and disappears from the screen, the character
  308. loses either a life, a point, or coins, depending on the mode of play. Brawl
  309. includes a function which allows players to create profiles with personalized
  310. button configurations for each control method along with their chosen username.");
  311. }
  312. elseif ($row["Age"] = 'Upto Rating 16s')
  313. {
  314. //echo "name: " . $row["Name"]. " - age: " . $row["Age"];
  315. mail($_Email,'Product Suggestions For '. $row["Name"], "Hello, " . $row["Name"].
  316. " | Age: " . $row["Age"]. " | Thankyou for visiting Teh Games and completing the survey,
  317. here are the some games that we think you might like: Mirror's Edge Catalyst!
  318. Mirror's Edge Catalyst is a first-person action-adventure game in which players
  319. take control of Faith Connors as she progresses through a futuristic city called Glass.
  320. Similar to the original Mirror's Edge, players traverse the city using aspects of urban
  321. exploration and parkour movements to complete missions and evade enemies or knock them
  322. off of their feet. Players can also make use of environmental objects such as zip-lines
  323. and ledges, and equipment including Mag Rope and Disruptor[3] to travel across buildings.
  324. When players mark an objective on their map, Faith's 'runner vision' is activated and some
  325. scenery items automatically highlight in red. These act as guides to lead players towards
  326. their objective.[4] The use of levels and linear gameplay found in the first Mirror's Edge
  327. has been replaced with an open-world, free-roaming environment. This gives players more
  328. freedom in traversal, allowing for the use of multiple paths to reach one's objective.
  329. In addition to the campaign's mission, side activities such as time trials, races and
  330. environmental puzzles will be featured. DICE also promises that no loading screen will
  331. be included in the final game, allowing for freedom to travel within all areas without
  332. loading delays. Additionally, items called Gridleaks can be found across the world that
  333. can be collected by players.");
  334. }
  335. elseif ($row["Age"] = 'Rating 18s')
  336. {
  337. //echo "name: " . $row["Name"]. " - age: " . $row["Age"];
  338. mail($_Email,'Product Suggestions For '. $row["Name"], "Hello, " . $row["Name"].
  339. " | Age: " . $row["Age"]. " | Thankyou for visiting Teh Games and completing the survey,
  340. here are the some games that we think you might like: Battlefield 4! Battlefield 4 is a
  341. 2013 first-person shooter video game developed by Swedish video game developer EA Digital
  342. Illusions CE (DICE) and published by Electronic Arts. It is a sequel to 2011's Battlefield
  343. 3 and was released on October 29, 2013 in North America, October 31, 2013 in Australia,
  344. November 1, 2013 in Europe and New Zealand and November 7, 2013 in Japan for Microsoft Windows,
  345. PlayStation 3, PlayStation 4, Xbox 360 and Xbox One. Battlefield 4 was met with positive reception.
  346. It was praised for its multiplayer mode, gameplay and graphics,
  347. but was also criticized for its short and shallow single-player campaign mode,
  348. and for its numerous bugs and glitches. It was a commercial success, selling over 7 million copies.");
  349. }
  350. }
  351. }
  352. else
  353. {
  354. echo "0 results";
  355. }
  356. }
  357. }
  358. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement