Exforsys

Free Training

Get Pagename From URL

This is a discussion on Get Pagename From URL within the PHP forums, part of the Programming Talk category; hi, How to get the page name from the Url.For Example My urls is like exforsys . com/viewtopic.php Then how ...

Go Back   Exforsys > Programming Talk > PHP

Exforsys.com

  #1 (permalink)  
Old 04-07-2009, 09:07 AM
Junior Member
 
Join Date: Apr 2009
Posts: 7
Surya100 is on a distinguished road
Get Pagename From URL

hi,

How to get the page name from the Url.For Example My urls is like exforsys . com/viewtopic.php

Then how to get page name viewtopic.php. How can i do that?

Thanks,
Surya
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-08-2009, 02:29 PM
Junior Member
 
Join Date: Nov 2006
Posts: 26
megabyte is on a distinguished road
Use this basename() on the path.

Example :

<?php
$path = "/home/httpd/html/index.php";
$file = basename($path); // $file is set to "index.php"
$file = basename($path, ".php"); // $file is set to "index"
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:01 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.