Guest User

php

a guest
Aug 8th, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2. require 'db.php';
  3.  
  4. if(isset($_POST['search_term'])){
  5.     $search_term = mysql_real_escape_string(htmlentities($_POST['search_term']));
  6.        
  7.     if(!empty($search_term)){
  8.        
  9.         $search=mysql_query("Select email from data WHERE email like '%$search_term%'" );
  10.         $result_count= mysql_num_rows($search);
  11.        
  12.         $suffix = ($result_count != 1) ? 's': '';
  13.        
  14.        
  15.         while($result_row=mysql_fetch_assoc($search)){
  16.             echo '<p><strong><div class="inner2">'.$result_row['email'].'</div></strong></p>';
  17.            
  18.         }
  19.        
  20.     }
  21. }
  22.  
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment