note 109533 added to function.include

From: Date: Thu, 26 Jul 2012 20:55:47 +0000
Subject: note 109533 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-189411@lists.php.net to get a copy of this message
Based on bimal at sanjaal dot com 15-Jun-2011 01:22 If you need include file c.php and c.php include d.php. The best way for c.php works for all other referred files is change to document root, and include/require d.php (from document root), then change the dir back. file c.php: <?php $now_at_dir = getcwd(); chdir(realpath($_SERVER['DOCUMENT_ROOT'])); require_once("path/from/root/yourfile.php"); chdir($now_at_dir); ?> hope it helps. ---- Server IP: 69.147.83.197 Probable Submitter: 173.227.93.138 ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- https://master.php.net/note/edit/109533 Del: integrated -- https://master.php.net/note/delete/109533/integrated Del: useless -- https://master.php.net/note/delete/109533/useless Del: bad code -- https://master.php.net/note/delete/109533/bad+code Del: spam -- https://master.php.net/note/delete/109533/spam Del: non-english -- https://master.php.net/note/delete/109533/non-english Del: in docs -- https://master.php.net/note/delete/109533/in+docs Del: other reasons-- https://master.php.net/note/delete/109533 Reject -- https://master.php.net/note/reject/109533 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#189411) next »