Advertisement
Guest User

Untitled

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