This blog has moved!

Go to the new address.

Tuesday, March 14, 2006

 

PATH_INFO problem fixed

Yesterday evening I actually stepped away from gaming for a second to fix a fairly major problem with Project Krystal (which I haven't talked about for so long, I better tell you it's a Website Management System and it renders your website from a MySQL database setup).

The problem was in the way that some pages used data after the .php bit of the URL, for example: http://server/products/chainsaws.php/4. In either PHP 5.x (or our remote server setup), the $_SERVER['PATH_INFO'] variable wasn't getting passed to the script, so I devised a slightly messy workaround:

$var = $_SERVER['REQUEST_URI'];
$pro = strstr($var, strrchr($var, ".php/"));
$pro2 = substr($pro, 5);
// echo $pro2;
// die();
$featureidrq = $pro2;
if (empty($featureidrq)) {
$featureidrq = "";
}
Again, if anyone can do any better I'd love to see you add a comment with your code.





<< Home