View Single Post
  #2 (permalink)  
Old 06-02-2004, 07:33 AM
jitender's Avatar
jitender jitender is offline
Site Admin
 
Join Date: Jun 2004
Posts: 1,197
jitender has a spectacular aura aboutjitender has a spectacular aura aboutjitender has a spectacular aura about
iTrader: (0)
Default

Hi jhon

Welcome to this forum,

Please try below to convert dynamic url to static

Apache has a global variable called $PATH_INFO that is created on every HTTP request, What this variable contains is the script that's being called, and everything to the right of that information in the URL. $PATH_INFO will contain article.php/12.

First you have to split this into variables you can use. And you can do that using PHP’s explode function:

$var_array = explode("/",$PATH_INFO);

Once you do that, you’ll have the following information:

Code:
$var_array[0] = "article.php" $var_array[1] = 12

rename the variable you get $var_array[1] as $article

if your artical has multiple page you can also get the page value here

article.php/12/1 explode this

$var_array = explode("/",$PATH_INFO);

Code:
$var_array[0] = "article.php" $var_array[1] = 12 $var_array[2] = 1
$var_array[1] as $article and $var_array[2] as $page_num and get the value from database.


may be it will help you make dynamic url to static url

Regards
Jitender
Reply With Quote