Ludatha
11-29-2008, 05:29 PM
Can someone help me display an image, I don't know how
<?php
// Work around the Flash Player Cookie Bug
if (isset($_POST["PHPSESSID"])) {
session_id($_POST["PHPSESSID"]);
}
if(isset($_GET['id']) && isset($_GET['type'])){
mysql_connect('localhost', 'root', '');
mysql_select_db('ludatha_base');
$id = $_GET['id'];
$sql = "SELECT * FROM images WHERE code = '$id'";
$result = mysql_query($sql);
$linkege=mysql_fetch_array($result);
if($_GET['type'] == 'pic'){
$file = 'upload/1/pictures/' . $linkege['file'];
}else{
$file = 'upload/1/pictures/' . $linkege['thumb'];
}
header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=' . $file . '.jpg');
echo $file;
}
?>
$linkege['file'] gets the file name of the image
Thanks in advance!
<?php
// Work around the Flash Player Cookie Bug
if (isset($_POST["PHPSESSID"])) {
session_id($_POST["PHPSESSID"]);
}
if(isset($_GET['id']) && isset($_GET['type'])){
mysql_connect('localhost', 'root', '');
mysql_select_db('ludatha_base');
$id = $_GET['id'];
$sql = "SELECT * FROM images WHERE code = '$id'";
$result = mysql_query($sql);
$linkege=mysql_fetch_array($result);
if($_GET['type'] == 'pic'){
$file = 'upload/1/pictures/' . $linkege['file'];
}else{
$file = 'upload/1/pictures/' . $linkege['thumb'];
}
header('Content-Type: image/jpeg');
header('Content-Disposition: inline; filename=' . $file . '.jpg');
echo $file;
}
?>
$linkege['file'] gets the file name of the image
Thanks in advance!