This is a discussion on "[SOLVED] getting page file name." within the PHP Forum section. This forum, and the thread "[SOLVED] getting page file name. are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] getting page file name.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] getting page file name.
hello, I have a file called lol.php - header.php is included into lol.php. header.php contains the script, and it needs to be here for asthetical reasons, and the function. I need to get the page name of lol.php from header.php. is this possible?
|
|
|
|
||||
|
Re: getting page file name.
That was confusing and made little sense.
Post your code.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: getting page file name.
sorry, im very bad at explaining.
I have made an online example. http://www.killerchutney.com/lol.php (aptly named heres the code in header.php
you can see in the left corner of the green div /templates/header.php - the include file name. but in the address bar it says http://www.killerch.../lol.php I need it to detect the URL shown in the address bar, instead the URL of the include. Last edited by KillerChutney; Nov 11th, 2007 at 17:29. |
|
|||
|
Re: getting page file name.
Hmm, why do you want to detect a page? Can you describe your full goal. I have never come across a reason to detect another page unless there is some form or other data that needs to be validated...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
||||
|
Re: getting page file name.
WHy don't you create a global variable in the lol.php with the file name before you include the file?
The variable will hold the $_SERVER['php_self'] of lol.php and that way, because header.php gets all the variables declared when it is included, it has access to the calling file name.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: getting page file name.
ah! ok thank you this coupled with an answer from another forum it works perfectly now
|
|
||||
|
Re: getting page file name.
No problems
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] sql file problem | longstand | Databases | 1 | Oct 27th, 2007 17:09 |
| How to link HTML page to CSS file | winwin | Web Page Design | 18 | Dec 21st, 2006 09:46 |
| upload file submitted from .html page | simonneaves | ASP.NET Forum | 0 | Jun 2nd, 2006 17:08 |
| Delete file in password protected page. | SweetLou | Classic ASP | 4 | Jan 7th, 2006 21:15 |
| file field in ASP page | lameneural | Classic ASP | 18 | Dec 8th, 2005 11:46 |