#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    29
    Rep Power
    0
    Hi,

    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?

    Laz

  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    29
    Rep Power
    0
    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?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London/UK
    Posts
    91
    Rep Power
    14
    $filename = ereg_replace("^/","",$filename);

    in english:

    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 ""

    hth
    Bealers

    ------------------
    http://back-end.org

    [This message has been edited by Bealers (edited August 15, 2000).]

Similar Threads

  1. Getting database info based on db info
    By Zamees in forum PHP Development
    Replies: 3
    Last Post: February 2nd, 2004, 08:55 PM
  2. Can I change the URL visible info?
    By coverman in forum PHP Development
    Replies: 2
    Last Post: January 5th, 2004, 07:29 AM
  3. Change ip url to domain
    By crypt1c_c0d3 in forum Apache Development
    Replies: 2
    Last Post: January 2nd, 2004, 09:55 AM
  4. Creating forum. Need help with URL commands.
    By barcodegeek in forum PHP Development
    Replies: 10
    Last Post: December 17th, 2003, 08:44 PM
  5. Simple Q: Variables in URL
    By davidDuke in forum ASP Programming
    Replies: 5
    Last Post: November 17th, 2003, 04:20 PM

IMN logo majestic logo threadwatch logo seochat tools logo