I want to display the images on the php page. Can anybody help? heres the code.
Thanks in advance.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Sat, 17 Dec 2011 01:37:35 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<?php
$reload=$_SERVER['PHP_SELF'];
?>
<form name='download' method='post' name='download' action="<?php $reload?>">
<?php
$dir="d:Upload/";
if(is_dir($dir))
{
if($folder=opendir($dir))
{
echo 'Current files: ';
while(($file=readdir($folder))!==false)
{
if(filetype($dir.$file)!='dir'){
echo "<br>  <input type='checkbox' name='boxes[]' value='$file'>'$file'</input>";
}
}
closedir($folder);
}
session_start();
$_SESSION['dir']=$dir;
}
?>
<br>
<input type="submit" name="submit" value="Download selected file/s"/>
</form>
<?php
if(isset($_POST['submit']))
{
$dir=$_SESSION['dir'];
$index=0;
echo 'Total count: '.count($_POST['boxes']).'';
while($index<count($_POST['boxes']))
{
if(isset($_POST['boxes'][$index]))
{
$file=$_POST['boxes'][$index];
$path="$dir$file";
echo "<br>$path";
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($path));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($path));
ob_clean();
flush();
readfile("$path");
/*This is what I did but seems it has no changes at all, where have I done wrong?, and I'm new to this actually*/
$image=createimagefromjpeg("$path");
header('Content-Type:image/jpeg');
echo "imagejpeg($image)helo";
/*ends here*/
}
else
echo "<br>Index: $index not set";
$index++;
}
}
?>
</body>
</html>