TEENFRONT Posted July 16, 2006 Share Posted July 16, 2006 Hey,I use mod_rewrite to rewrite the URLs of my reviews section, so all my reviews ( music, movie, games ) all run from the same display_reviews.php file. Yet the address is teenfront.co.uk/movie-reviews/$name/$id.phpIs there a way to get that url? i wanna do some if statements so like if($type == "Movie") etc. Now i know i can query the database to get the type of review then display info based on that, but i was wondering if its possible to get that rewritten url from somewhere? it willcome in handy for other things aswell Quote Link to comment https://forums.phpfreaks.com/topic/14770-get-page-name/ Share on other sites More sharing options...
Gast Posted July 16, 2006 Share Posted July 16, 2006 The original URL or the one re-written with mod_rewrite?Anyway, you can use $_SERVER['PHP_SELF'] to get the current page name. Then you can split it with explode() by the /'s. Quote Link to comment https://forums.phpfreaks.com/topic/14770-get-page-name/#findComment-59066 Share on other sites More sharing options...
TEENFRONT Posted July 17, 2006 Author Share Posted July 17, 2006 the rewritten one.... i wanna grab the movie-reviews/$name/$id.php , but whenever i try to do that ( $_SERVER['PHP_SELF'] ), it grabs the display_reviews.php file. Quote Link to comment https://forums.phpfreaks.com/topic/14770-get-page-name/#findComment-59693 Share on other sites More sharing options...
akitchin Posted July 18, 2006 Share Posted July 18, 2006 this may sound dumb, but if it's the variables you're after, they're sitting in the request superglobal for display_reviews.php, n'est-ce pas? technically you could just rebuild the URL you want. Quote Link to comment https://forums.phpfreaks.com/topic/14770-get-page-name/#findComment-59764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.