note 72269 added to function.include

From: Date: Wed, 10 Jan 2007 11:12:48 +0000
Subject: note 72269 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-121522@lists.php.net to get a copy of this message
If you want the "include" function to work correctly with paths and GET parameters, try the following code: <?php $_GET['param1'] = 'param1value'; $_GET['param2'] = 'param2value'; @include($_SERVER['DOCUMENT_ROOT'] . "/path1/path2/include.php"); ?> Then within your "include.php" use $_GET['param1'] and $_GET['param2'] to access values of parameters. I spent several hours to figure this out. ---- Server IP: 83.138.144.80 Probable Submitter: 138.40.192.246 ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- https://master.php.net/note/edit/72269 Del: integrated -- https://master.php.net/note/delete/72269/integrated Del: useless -- https://master.php.net/note/delete/72269/useless Del: bad code -- https://master.php.net/note/delete/72269/bad+code Del: spam -- https://master.php.net/note/delete/72269/spam Del: non-english -- https://master.php.net/note/delete/72269/non-english Del: in docs -- https://master.php.net/note/delete/72269/in+docs Del: other reasons-- https://master.php.net/note/delete/72269 Reject -- https://master.php.net/note/reject/72269 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121522) next »