RE: [PHP] Limitation to URL params on Include()?

From: Date: Wed, 14 Jul 2004 18:36:01 +0000
Subject: RE: [PHP] Limitation to URL params on Include()?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190521@lists.php.net to get a copy of this message
Hi Alex, In that case, make your include file local; don't use the URL, use a relative path to the file. Make the include file have a function you can call or be an object you can instantiate. ex: block.php <?php function display_block($header,$content,$link,$andsuch) { // php code here to output HTML using echo... or ?> ... direct html output here ... and a variable output such as <?php echo $header; ?> and some more html, blah blah blah <?php } // end of display_block function ?> Then in your main program do: <?php ... include_once("block.php"); ... ... display_block($header,$content,$link,$andsuch); ... ... display_block($header2,$content2,$link2,$andsuch2); ... ... ?> Or as an object: ... $block=new Block($header,$content,$link,$andsuch); $block->display(); ... Regards, James Harrell http://celestia.cbstech.com

« previous php.general (#190521) next »