Advertisement
Guest User

Untitled

a guest
Mar 25th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. // WIJZIG ENKEL CODE IN HET PHP BLOCK
  3. // SQL CONNECTION DETAILS:
  4. // server: localhost
  5. // user: faker
  6. // password: SG3wyi0SbGGz2&KLb
  7. // database: www.professormode.com
  8.  
  9. $country = "?";
  10. if( !empty($_POST) ){
  11. $conn = new PDO('mysql:host=localhost;dbname=www.professormode.com', 'faker', 'SG3wyi0SbGGz2&KLb');
  12.  
  13. $user = $_POST['emails'];
  14.  
  15. $statement = $conn->prepare("SELECT * FROM faker_users WHERE email = '$user'");
  16. $statement->execute();
  17. $result = $statement->fetch(PDO::FETCH_ASSOC);
  18. $country = $result['country'];
  19. var_dump($result);
  20.  
  21. echo "Er werd iets gesubmit!";
  22.  
  23.  
  24. }
  25.  
  26.  
  27. ?>
  28. <!-- WIJZIG DE CODE HIERONDER NIET -->
  29. <form method="post" action="">
  30. <label for="emails">Select a person</label>
  31. <select name="emails" id="emails">
  32. <option value="">Select a person</option>
  33. <option value="vandervort.lenore@crist.net">vandervort.lenore@crist.net</option>
  34. </select>
  35. <button type="submit">Search country</button>
  36. </form>
  37.  
  38. <h3>This person lives in
  39. <span id="country"><?php echo $country; ?></span>
  40. </h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement