Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   phphq.Net Forums (https://novahq.net/forum/forumdisplay.php?f=277)
-   -   Page Name (https://novahq.net/forum/showthread.php?t=39877)

atholon 10-16-2007 06:04 PM

Page Name
 
Is there a way to get the Page.php to know its own name? Like a getfilename() function so tha it shows that file name?

Lakie 10-16-2007 06:30 PM

try

PHP Code:

echo('file = '.basename ($PHP_SELF,".php")); 

http://au.php.net/basename

atholon 10-16-2007 06:38 PM

hmm I did something like that but I think there is a probablem because I am not passing it in the header of the functions that use it.

It is another freaking:
Notice: Undefined variable: pagename in d:\easyphp\www\video.php on line 224

Thing is that it is defined....I placed: $pagename="video.php"; at the top of the file.

Scott 10-17-2007 01:13 AM

could you post a bit more of your code?

atholon 10-17-2007 09:41 AM

Got it reslolved. The reason was because I was not passing it through the () at the top of the functions that were going to us it.

$_SERVER[PHP_SELF] was what I was looking for. It will save a lot of headaches in the future.


All times are GMT -5. The time now is 02:10 PM.

Powered by vBulletin®