Web Hosting Talk







View Full Version : How to replace question marks with forward slashes in URL's


ZBoca
11-02-2002, 06:45 PM
Hi,

I have a PHP script that places question marks in the URL, and I'm trying to get it to replace them with forward slashes. Does anyone know of a resource that can help with this?

I'm pretty sure it comes down to a Apache mod, but unfortionately this isn't my area of expertise.

Thanks any help.

Zak

The Prohacker
11-02-2002, 10:15 PM
<?php
$url=explode("/",$REQUEST_URI);
//The above gets the URI string aka /test.php/asd/skjle
//and explodes it into an array...



$id=$url[0];
//That signifies the first thing in the URI array, aka test.php
$id=$url[1];
//This signafies the second thing in the URI array aka asd
$id=$url[2];
//This signafies the third thing in the URI array aka skjle

?>

Just that easy :D

ZBoca
11-03-2002, 03:07 AM
Wow- I sure appreciate you taking the time in doing that for me.

Would I simply place this in each php file?

Sorry- I know absolutely nothing about PHP.

Thanks again-- very kind of you.

Zak

ZBoca
11-03-2002, 03:12 AM
If you go to http://www.ratemyhost.com/view_ratings.php and mouse over "View" on the right side, you'll see what I'm trying to get rid of.

A typical URL for these would be
http://www.ratemyhost.com/view_rating.php?id=12