View Single Post
  #5 (permalink)  
Old 04-15-2007, 03:55 PM
trigger55 trigger55 is offline
Junior Member
 
Join Date: Apr 2007
Posts: 16
trigger55 is on a distinguished road
iTrader: (0)
Default

Quote:
Originally Posted by jitender
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

good job ....
Reply With Quote