Guest User

Untitled

a guest
Jul 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if(isset($_POST['action']) == 'send') {
  5.  
  6. //Location
  7. $file_location = "marry.html";
  8. //Read the file
  9. $fileContents = file_get_contents($file_location);
  10.  
  11. $search_var = '{'.preg_quote($_POST['keyword']).'}i';
  12. $matches = array();
  13. preg_match($search_var, $fileContents, $matches);
  14. echo '<b>Search Query: </b>'.$matches[0];
  15. //print_r($matches);
  16. if(!preg_match($search_var, $fileContents, $matches)) {
  17. echo "no matches.";
  18. }
  19.  
  20. }
  21.  
  22. ?>
Add Comment
Please, Sign In to add comment