note 98945 added to function.require-once

From: Date: Fri, 16 Jul 2010 20:33:19 +0000
Subject: note 98945 added to function.require-once
Groups: php.notes 
Request: Send a blank email to php-notes+get-170927@lists.php.net to get a copy of this message
If you are coding on localhost and require_once is not opening files due to 'relative paths' a simple solution is: <?php require_once(dirname(__FILE__) . "/file.php"); ?> If you have file.php under the folder 'includes' (or anywhere for that matter), then folder 'public' AND folder 'public/admin' will be able to access all required files despite having different relative paths. ---- Server IP: 208.69.120.55 Probable Submitter: 76.175.149.149 ---- Manual Page -- http://www.php.net/manual/en/function.require-once.php Edit -- https://master.php.net/note/edit/98945 Del: integrated -- https://master.php.net/note/delete/98945/integrated Del: useless -- https://master.php.net/note/delete/98945/useless Del: bad code -- https://master.php.net/note/delete/98945/bad+code Del: spam -- https://master.php.net/note/delete/98945/spam Del: non-english -- https://master.php.net/note/delete/98945/non-english Del: in docs -- https://master.php.net/note/delete/98945/in+docs Del: other reasons-- https://master.php.net/note/delete/98945 Reject -- https://master.php.net/note/reject/98945 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#170927) next »