NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How to echo filename.php?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 04-01-2003, 11:16 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Apr 2003
Posts: 14
Pimple is an unknown quantity at this point
 



How to echo filename.php?


Greetings, webdesigners! New on these forums

I need some n00b php help for my site. I want to have a "show source" link that, naturally, will show the source of the page. So I need to know how to echo or "output" the filename :/. This may be simple, but I have no clue
__________________
I am Pimple, hear my roar!
Pimple is offline  
Old 04-01-2003, 01:03 PM   #2 (permalink)
NamePros Regular
Join Date: Sep 2002
Location: Canada
Posts: 481
DarkDevil is an unknown quantity at this point
 



The best way i can think of to show the source of your website is to make copys of all your php files and then rename each .php extention to .phps and then link each page to the .phps file of the same name. Code is shown along with color codes. Though i know their are probibly other ways to do it. php.net does it on the bottom of their website with a link to source.php
__________________
Sometimes I lay awake at night and I ask "Where have I gone wrong?" Then a little voice says "This is going to take more than one night"
DarkDevil is offline  
Old 04-01-2003, 01:12 PM THREAD STARTER               #3 (permalink)
New Member
Join Date: Apr 2003
Posts: 14
Pimple is an unknown quantity at this point
 



Yeah. Well, I want to do it the way it's done on php.net hehe. I've made a file to show the sources, but the thing i need is to be able to echo the filename, so the link to the source.php pae automatically changes on the different pages
__________________
I am Pimple, hear my roar!
Pimple is offline  
Old 04-01-2003, 01:23 PM   #4 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



PHP actually has a built in function for that very task: http://www.php.net/manual/en/function.show-source.php

If you just want to echo the file name of the current page you can use:

PHP Code:
<?php echo basename($_SERVER['PHP_SELF']) ; ?>
:beer:
deadserious is offline  
Old 04-01-2003, 01:55 PM THREAD STARTER               #5 (permalink)
New Member
Join Date: Apr 2003
Posts: 14
Pimple is an unknown quantity at this point
 



Yay! Thanks
__________________
I am Pimple, hear my roar!
Pimple is offline  
Old 04-01-2003, 02:01 PM   #6 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



YW
deadserious is offline  
Closed Thread


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


 
All times are GMT -7. The time now is 02:04 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger