Advertisement
Guest User

Untitled

a guest
Apr 5th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. require_once 'users/init.php';
  3. require_once $abs_us_root.$us_url_root.'users/includes/template/prep.php';
  4. $searched = 0;
  5. $c = 0;
  6. if(!empty($_POST['submit'])){
  7. $fname = htmlspecialchars(Input::get('fname'));
  8. $lname = htmlspecialchars(Input::get('lname'));
  9. $q = $db->query("SELECT fname,lname,username,email FROM users WHERE fname LIKE ? AND lname LIKE ?",["%$fname%","%$lname%"]);
  10. $c = $q->count();
  11. $r = $q->results();
  12. $searched = 1;
  13. }
  14.  
  15. ?>
  16. <div id="page-wrapper">
  17. <div class="container">
  18. <div class="jumbotron">
  19. <form class="" action="" method="post">
  20. <input type="text" name="fname" value="" placeholder="first name">
  21. <input type="text" name="lname" value="" placeholder="last name">
  22. <input type="submit" name="submit" value="Go!">
  23. </form>
  24. </div>
  25. <div class="row">
  26. <div class="col-sm-12">
  27. <?php if($searched > 0){?>
  28. We found <?php echo $c ?> results.
  29. <table class="table table-striped">
  30. <?php foreach($r as $u){?>
  31. <tr>
  32. <td><?=$u->fname?></td><td><?=$u->lname?></td><td><?=$u->username?></td><td><?=$u->email?></td>
  33. </tr>
  34. <?php } ?>
  35.  
  36. </table>
  37. <?php }?>
  38. </div>
  39. </div>
  40. <?php languageSwitcher();?>
  41. </div>
  42. </div>
  43.  
  44. <!-- Place any per-page javascript here -->
  45.  
  46.  
  47. <?php require_once $abs_us_root . $us_url_root . 'usersc/templates/' . $settings->template . '/footer.php'; //custom template footer ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement