URL Question ..

Discussion in 'PHP' started by mab, Jul 8, 2008.

  1. #1
    Hello ..
    My Question is .
    i have a file called
    "ttp://domain.com/number.php"
    with .htaccess i've modified it to looks like
    "http://domain.com/number/6"

    well i want to give a "IF" condition ..
    how to get the url of the modified file ?

    i've tried __FILE__ but it gives "number.php"
    Any help ?
    Thanks .
     
    mab, Jul 8, 2008 IP
  2. clarky_y2k3

    clarky_y2k3 Well-Known Member

    Messages:
    114
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Hm, try using the following:
    
    $_SERVER['REQUEST_URI']
    
    PHP:
    Just to be sure can you post the output of this please (when requesting a page via the rewritten URL):
    
    print_r($_SERVER);
    
    PHP:
     
    clarky_y2k3, Jul 8, 2008 IP
    mab likes this.
  3. mab

    mab Active Member

    Messages:
    563
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Dude .. That's just awesome !
    Thanks a bunch !
     
    mab, Jul 8, 2008 IP