How can I view image using code like
Echo "<img src='image.php?image=12'>";
what is the code of image.php to do that ?
Printable View
How can I view image using code like
Echo "<img src='image.php?image=12'>";
what is the code of image.php to do that ?
There is no code to do that.
you could kinda do the same if you were reading the data from a database.PHP Code:if(isset($_REQUEST['Image'])){
switch($_REQUEST['Image']){
case "1":
header("Content-type: image/gif");
$filename = "images/one.gif";
$fp = fopen($filename,"r")or die("Something went wrong :S");
while(!feof($fp)){
$chunck= fread($fp,16);
print $chunck;
}
break;
case "2":
header("Content-type: image/gif");
$filename = "images/two.gif";
$fp = fopen($filename,"r")or die("Something went wrong :S");
while(!feof($fp)){
$chunck= fread($fp,16);
print $chunck;
}
break;
}
}