August 15th, 2000, 04:33 AM
I'm somewhat a newb, so please bear with me.
I am trying to build a .html page, but with highlighting depending on the URL. For example, I have a table with 3 cell components with links: a,b,c. Supposing I click on "b", the php code should check what URL we now have (www.server.com/b.html), see that it has b.html in it and print the cell for a in white, for b in blue and for c in white. If I now clicked on c, it would do the same thing and now c will have the cell background blue.
My question is: how can I get the URL and then make a search for a certain string in it? Specifically, so that it takes everything after the last "/", in other words in www.server.com/a.html, it would take a.html?
August 15th, 2000, 05:30 AM
Okay, I figured out how to get the path with REQUEST_URI, but I now get a result with /filename.php
How can I get rid of the "/" at the begining?
August 15th, 2000, 04:03 PM
$filename = ereg_replace("^/","",$filename);
my new variable = my old variable with pattern match for a '/' at _the beginning_ of it (thats what the '^' means) if so, replace with nothing ""
[This message has been edited by Bealers (edited August 15, 2000).]