Re: comparing $php_self with real file name

From: Date: Tue, 15 Apr 2003 10:29:58 +0000
Subject: Re: comparing $php_self with real file name
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-143896@lists.php.net to get a copy of this message
On Tuesday 15 April 2003 18:13, skate wrote: You have started a new thread by taking an existing posting and replying to it while you changed the subject. That is bad, because it breaks threading. Whenever you reply to a message, your mail client generates a "References:" header that tells all recipients which posting(s) your posting refers to. A mail client uses this information to build a threaded view ("tree view") of the postings. With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread it has nothing to do with. Always do a fresh post when you want to start a new thread. To achieve this, click on "New message" instead of "Reply" within your mail client, and enter the list address as the recipient. You can save the list address in your address book for convenience. > okay, i've checked thru the manual and can't find what i'm looking for. i'm > probably not looking hard enough or summit tho, so please excuse... > > if have this... > > <?php > if( basename($_SERVER['PHP_SELF']) == "style.php" ) > { > Header( "Location: ../index.php" ); > } > ?> > > at the top of my style sheet include to stop people accessing it directly. > but i'd like to this a little more dynamically so i can include it in every > include file. i want to compare the php_self with the real file name of > that file... > > but i can't find how to get the real file name? I'm sure $_SERVER has all you're looking for. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* All a man needs out of life is a place to sit 'n' spit in the fire. */

« previous php.general (#143896) next »