note 28389 deleted from function.include by vincent

From: Date: Mon, 08 Sep 2003 15:03:56 +0000
Subject: note 28389 deleted from function.include by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55834@lists.php.net to get a copy of this message
Note Submitter: webmaster at nospam dot pczb dot net ---- I searched for a php file/function which would return an image. Here it is: <?php include("D:/pczb.net/functions.php"); if($show) { $result = mysql_query("SELECT * FROM picoftheweek WHERE id = '$show'"); $row = @mysql_fetch_array($result); header("Content-Type: ".$row[filetype]); header("Content-length: ".filesize($row[location])); if( file_exists($row[location]) ) { include($row[location]); } } ?> I use this for displaying images that have been placed outside the server document root dir. Users now cannot view files I don't want them to view (yet). You can view an example on www.pczb.net/picoftheweek.php

« previous php.notes (#55834) next »