Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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. $input = $_POST['emails'];
  13.  
  14. echo $input;
  15.  
  16. $statement = $conn->prepare("SELECT * FROM faker_users WHERE `email`= :email");
  17. $statement->bindParam(":email", $input);
  18. $result = $statement->execute();
  19.  
  20. $user = $statement->fetch(PDO::FETCH_ASSOC); //fetch assoc wilt zeggen uitlezen in array
  21. $country = $user['country'];
  22.  
  23. }
  24.  
  25.  
  26. ?>
  27. <!-- WIJZIG DE CODE HIERONDER NIET -->
  28. <form method="post" action="">
  29. <label for="emails">Select a person</label>
  30. <select name="emails" id="emails">
  31. <option value="">Select a person</option>
  32. <option value="vandervort.lenore@crist.net">vandervort.lenore@crist.net</option>
  33. </select>
  34. <button type="submit">Search country</button>
  35. </form>
  36.  
  37. <h3>This person lives in
  38. <span id="country"><?php echo $country; ?></span>
  39. </h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement