I made code using php in which it will display all the images in browser from specified path with define width and height. now I want to develop a code in which if I click on any of the image it should display me in original size in new window. please guide. don't know how to do it.
Edited Question
image.php
<script language="javascript"> //disabling right click
document.onmousedown=disableclick;
status="Right Click Disabled";
function disableclick(event)
{
if(event.button==2)
{
alert(status);
return false;
}
}
</script>
<?php //displaying images on browser
$dir= '../images/';
$file_display = array('jpg','jpeg','png','gif');
if (file_exists($dir) == false)
{
echo 'Directory \''. $dir. '\' not found!';
}
else
{
$dir_contents = scandir($dir);
foreach ($dir_contents as $file)
{
$tmp = explode('.', $file);
$f_e = end($tmp);
$file_type = strtolower($f_e);
if ($file !== '.' && $file !== '..' && in_array($file_type, $file_display) == true)
{
echo '<img src="'. $dir.$file. '" alt="'.$file. '"style="width:250px;height:250px" />';
}
}
}
?>
this code will display all the images on browser, in browser if m clicking on any of the images that images should be displayed on new window.
How can I get image id of the clicked image?