note 84198 added to function.strrpos

From: Date: Thu, 03 Jul 2008 00:44:20 +0000
Subject: note 84198 added to function.strrpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-141099@lists.php.net to get a copy of this message
I had a problem where I was using the following in my .htaccess file. php_value auto_prepend_file "pre.php" php_value auto_append_file "post.php" Not knowing how to prevent the htaccess directives from cascading, without having to put an override .htaccess in each subfolder, I figured, just prevent output in my pre and post scripts if we weren't in the root folder! I did it using this line of code: if (strrpos($_SERVER["REQUEST_URI"], "/") != 0) return; Prevents execution of the rest of the script, and most importantly, doesn't output anything before any other headers may be sent by things in other folders (like my wiki site). ---- Server IP: 208.69.120.35 Probable Submitter: 24.252.61.74 ---- Manual Page -- http://www.php.net/manual/en/function.strrpos.php Edit -- https://master.php.net/note/edit/84198 Del: integrated -- https://master.php.net/note/delete/84198/integrated Del: useless -- https://master.php.net/note/delete/84198/useless Del: bad code -- https://master.php.net/note/delete/84198/bad+code Del: spam -- https://master.php.net/note/delete/84198/spam Del: non-english -- https://master.php.net/note/delete/84198/non-english Del: in docs -- https://master.php.net/note/delete/84198/in+docs Del: other reasons-- https://master.php.net/note/delete/84198 Reject -- https://master.php.net/note/reject/84198 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141099) next »