Advertisement
Guest User

sec 5

a guest
Dec 10th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. if (isset($_GET['search'])) {
  2.  
  3. $result = $sql->query("SELECT name, site, message, `when` FROM messages WHERE message LIKE '%" . mysqli_real_escape_string($sql, $_GET['search']) . "%'");
  4.  
  5. while($res = mysqli_fetch_assoc($result)) {
  6.  
  7. ?>
  8.  
  9. <div class="descr"><?=$res['when']?> door <?
  10.  
  11. if (substr_compare($res['site'], "http://", 0, 7, true) != 0 &&
  12.  
  13. substr_compare($res['site'], "https://", 0, 8, true) != 0) {
  14.  
  15. $res['site'] = " ";
  16.  
  17. }
  18.  
  19. ?><a href="<?= htmlspecialchars($res['site'], ENT_QUOTES)?>"><?=htmlspecialchars($res['name'], ENT_QUOTES)?></a></div>
  20.  
  21. <blockquote>
  22.  
  23. <p><?=htmlspecialchars($res['message'], ENT_QUOTES)?></p>
  24.  
  25. </blockquote>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement