| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Apr 2003
Posts: 14
![]() | 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! |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Sep 2002 Location: Canada
Posts: 481
![]() | 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" |
| |
| | THREAD STARTER #3 (permalink) |
| New Member Join Date: Apr 2003
Posts: 14
![]() | 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! |
| |
| | #4 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | 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: |
| |