Re: Read Vs. Include

From: Date: Wed, 31 Jan 2001 12:27:34 +0000
Subject: Re: Read Vs. Include
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-37462@lists.php.net to get a copy of this message
On Tuesday, January 30, 2001 at 3:04 PM, Alexandar Skwar wrote: > So sprach Daniel Grace am Thu, Jan 25, 2001 at 07:18:52PM -0800: > > readfile($filename); > > Why not include? > Because include will execute any PHP code in the included file and readfile will not, it just dumps the entire file to the webbrowser. If you want to display the contents of an HTML document and that HTML document should not have any PHP code in it, it's best to play it safe and use readfile(). This is especially true if the HTML document can be visitor modified (say, a guestbook), as not doing so could potentially let anybody execute any PHP code they want on your webserver. - Daniel Grace <http://dewin.oldbattery.com/> "Space may be the final frontier but its made in a Hollywood basement." - Red Hot Chili Peppers - Californication

« previous php.general (#37462) next »