Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame^] | 1 | <html> |
| 2 | <head> |
| 3 | <meta charset="UTF-8"> |
| 4 | <title>PĂ gina de benvinguda</title> |
| 5 | <link rel="stylesheet" href="./css/basic.css" /> |
| 6 | <link rel="stylesheet" href="./css/login.css" /> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div id="outter-container"> |
| 10 | <div id="inner-container"> |
| 11 | <h1>Selecciona el teu nom</h1> |
| 12 | <h3>Per entrar al joc de la Pastanaga Assessina</h3> |
| 13 | <form action="main.php" method="GET"> |
| 14 | <select name="user"> |
| 15 | <?php |
| 16 | // Define MySQL login variables |
| 17 | $servername = "fdb22.awardspace.net"; |
| 18 | $username = "3155560_users"; |
| 19 | $password = "btechnoro@fox4news.info"; |
| 20 | |
| 21 | // Create connection |
| 22 | $conn = new mysqli($servername, $username, $password, "3155560_users"); |
| 23 | if ($conn->connect_error) die("Connection failed: " . $conn->connect_error); |
| 24 | $conn->set_charset("utf8"); |
| 25 | |
| 26 | // Do the query |
| 27 | $query = "SELECT * FROM users"; |
| 28 | |
| 29 | // Fetch the information of the user |
| 30 | if ($result = $conn->query($query)) { |
| 31 | while ($row = $result->fetch_row()) { |
| 32 | $id = $row[0]; |
| 33 | $nomcomplet = $row[1]; |
| 34 | $curs = $row[2]; |
| 35 | $grau = $row[3]; |
| 36 | $quimata = $row[4]; |
| 37 | |
| 38 | // Echo the options |
| 39 | echo "<option value='".$id."'>".$nomcomplet."</option>\n"; |
| 40 | } |
| 41 | $result->close(); |
| 42 | } else { |
| 43 | die("Wrong query: " . $query); |
| 44 | } |
| 45 | |
| 46 | // Close connection |
| 47 | $conn->close(); |
| 48 | ?> |
| 49 | </select> |
| 50 | |
| 51 | <input type="submit" value="Entrar" /> |
| 52 | </form> |
| 53 | </div> |
| 54 | </div> |
| 55 | </body> |
| 56 | </html> |