Current location: Hot Scripts Forums » Programming Languages » PHP » How do i take the page name after the /


How do i take the page name after the /

Reply
  #1 (permalink)  
Old 02-17-06, 10:35 AM
xxvatarxx xxvatarxx is offline
Wannabe Coder
 
Join Date: May 2005
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
How do i take the page name after the /

How do i get the name of a page after the / in the url? so

www.mysite.com/page37.php would return the value page37.php ?

How do i do this?
Reply With Quote
  #2 (permalink)  
Old 02-17-06, 10:50 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
PHP Code:



echo $_SERVER["REQUEST_URI"]; 
Reply With Quote
  #3 (permalink)  
Old 02-17-06, 04:58 PM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
ignore nico he didnt read the question
PHP Code:

echo basename(__FILE__); 

or...
PHP Code:

echo basename($_SERVER["REQUEST_URI"]); 

__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.

Last edited by FiRe; 02-17-06 at 05:05 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Passing a variable to another page tapir PHP 8 02-16-05 05:38 PM
need help creating an update & confirm page mikewooten PHP 1 11-08-04 04:28 PM
page browsing problem mivec PHP 3 04-17-04 03:43 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 06:34 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.