title: dynamic php short url
body: <p>So I've been using a procedural programming style in PHP since 2006.
  But missed out on a lot of time the past 4+ years with getting any better.</p>
  
  <p>Recently I've started to acknowledge object oriented programming more.</p>
  
  <p>The thing that points out to me with it the most, is the MVC style organization and short urls.</p>
  
  <p>instead of url being "index.php?page=profile&amp;member=1", it would be "page/profile/member/1".</p>
  
  <p>I'm trying to learn OOP&amp;MVC architecture with using a wide range of resources, but it is still a bit too much for me to grasp. Even after a month!</p>
  
  <p>I've always just used basic function(etc) {}, if,else,and,or statements and SQL queries to get the job done. That knowledge up til now has mostly covered everything I needed.</p>
  
  <p>I'm wondering if there is a way to use my basic procedural programming style and still achieve shortened urls?</p>
  
  <p>I've tried this method below</p>
  
  <p><strong>.htaccess</strong></p>
  
  <pre><code>RewriteEngine On
  RewriteCond $1 !^(index\.php)
  RewriteRule ^(.*)$ index.php?page=$1 [L]
  </code></pre>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;?php
  
  $links = parse_ini_file('links.ini');
  
  if (isset($_GET['page']) &amp;&amp; array_key_exists($_GET['page'], $links)) {
      require $links[$_GET['page']];
  }
  else {
      echo '
      Home page or unknown link
      ';
  }
  </code></pre>
  
  <p><strong>links.ini</strong></p>
  
  <pre><code>members  = pages/members.php
  profile  = pages/profile.php
  </code></pre>
  
  <p>This method works on simply shortening a URL, but I don't know how to make it work with profile/user/1 aka index.php?page=profile&amp;user=1
  (the user variable being a database query)</p>
  
  <p>Any help would be greatly appreciated!!!</p>