daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <IfModule mod_rewrite.c>
  2.  RewriteEngine On
  3.  RewriteBase /cms_project
  4.  RewriteCond %{REQUEST_URI} single(.*)
  5.  RewriteRule  ^(.+)$ single.php?url=$1
  6. </IfModule>
  7.    
  8. //want to query strings single/posts/1/post-title
  9. echo $_GET['url'];
  10.  
  11. OR
  12.  
  13. //function to get url query string convert it to an array
  14. function getUrl() {
  15.     if(isset($_GET['url'])) {
  16.         $url = rtrim($_GET['url'],'/');
  17.         $url = filter_var($url, FILTER_SANITIZE_URL);
  18.         $url = explode('/', $url);
  19.         return $url;
  20.     }
  21.   }
  22.   print_r($_GET['url']);
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