Advertisement
Guest User

Untitled

a guest
Mar 25th, 2018
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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['emails']) ){
  11. $conn = new PDO('mysql:host=localhost;dbname=www.professormode.com', 'faker', 'SG3wyi0SbGGz2&KLb');
  12. echo "Er werd iets gesubmit!";
  13.  
  14. $statement = $conn->prepare("SELECT country FROM faker_users
  15. WHERE email='vandervort.lenore@crist.net'");
  16.  
  17. $statement->execute();
  18.  
  19. echo $country;
  20. }
  21.  
  22.  
  23. ?>
  24. <!-- WIJZIG DE CODE HIERONDER NIET -->
  25. <form method="post" action="">
  26. <label for="emails">Select a person</label>
  27. <select name="emails" id="emails">
  28. <option value="">Select a person</option>
  29. <option value="vandervort.lenore@crist.net">vandervort.lenore@crist.net</option>
  30. </select>
  31. <button type="submit">Search country</button>
  32. </form>
  33.  
  34. <h3>This person lives in
  35. <span id="country"><?php echo $country; ?></span>
  36. </h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement