daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Dec 12th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. // check if query string is single or array
  4. $rows = explode("&", $_SERVER['QUERY_STRING']);
  5.  
  6. if (  count( $rows ) > 1 )
  7.     echo 'query string contains more than one query string value' ;
  8.  
  9. // Get filter from query string
  10. // 1 parameter only
  11. $qs = ( isset ( $_GET['filter']) )  ? htmlspecialchars( $_GET["filter"] ) :  ''  ;
  12. echo $qs ;
  13. // echo ( isset ( $_GET['filter']) )  ? htmlspecialchars( $_GET["filter"] ) :  ''  ;
  14.  
  15.  
  16. // for multiple query string filters
  17. $queries = array();
  18. parse_str( $_SERVER['QUERY_STRING'], $queries);
  19.  
  20. echo '<pre>' ;
  21. print_r( $queries ) ;
  22. echo '</pre>' ;
  23. exit() ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top