Location: PHPKode > projects > PHP MySQL Address Book > addressbook/showimage.php
<?php
require("sesionchk.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<?php
require("title.php");
?>
</title>
</head>

<body>
<?php
require("links.php");
include 'library/config.php';
include 'library/opendb.php';
if ($_GET['ID']>0)
{
//$query = "SELECT FirstName,EmailAddress,ID,Notes,imagename FROM contacts where ID=" .$_GET['ID'];
$query = "SELECT `imagedesc` FROM `tblimages` WHERE id =" .$_GET['ID']." and `imagename`='".$_GET['a']."'";
mysql_query("SET NAMES 'utf8'");
mysql_query('SET CHARACTER SET utf8'); 
/*$db_charset = mysql_query( "SHOW VARIABLES LIKE 'character_set_database'" );
$charset_row = mysql_fetch_assoc( $db_charset );
mysql_query( "SET NAMES '" . $charset_row['Value'] . "'" );
unset( $db_charset, $charset_row );

*/
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
include 'library/closedb.php';
if ($_GET['mod']=="del")
{
if ($_GET['fn']=="s")
{
$nodest="wabraaddressbook.php?ID=".$_GET['ID'];
}
else
{
$nodest="dtaildwabraaddressbook.php?ID=".$_GET['ID'];
}
echo "<strong>Do you realy want to Delete this Image ? <a href='library/delimg.php?ID=".$_GET['ID']."&nam=".$_GET['a']."&FN=".$_GET['fn']."'>Yes</a> <a href='".$nodest."'>No</a></strong><hr>";
}
echo $row['imagedesc']."<hr><br>";
$p="uploads/".$_GET['a'];
$mw='100';
$mh='100';
/* if(list($w,$h) = @getimagesize($p)) {
    foreach(array('w','h') as $v) { $m = "m{$v}";
        if(${$v} > ${$m} && ${$m}) { $o = ($v == 'w') ? 'h' : 'w';
        $r = ${$m} / ${$v}; ${$v} = ${$m}; ${$o} = ceil(${$o} * $r); } }
//echo "<center><img src='{$p}' alt='image' width='{$w}' height='{$h}'><br></center>";
//    return("<img src='{$p}' alt='image' width='{$w}' height='{$h}' />");
 }*/
echo "<center><img src='uploads/".$_GET['a']."'><br></center>";

}
else
{
echo "<center> Nothing to Display</center>";
}

?>

</body>
</html>
Return current item: PHP MySQL Address Book