Image Upload in php 6.0

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tobimichigan
Forum Commoner
Posts: 48
Joined: Sun May 10, 2009 1:35 pm

Image Upload in php 6.0

Post by tobimichigan »

Hi Guys,
Please I'm having a little bit of fuss in this code the image is displaying "x" rather than the expected image. The image uploads to the image folder but does not display on the browser.

Create Table

Code: Select all

<?php
$db = mysql_connect("localhost", "root", "") or
die ("Unable to connect. Check your connection parameters.");
mysql_select_db("moviesite", $db) or die(mysql_error($db));
//create the images table
$query = 'CREATE TABLE images (
image_id INTEGER NOT NULL AUTO_INCREMENT,
image_caption VARCHAR(255) NOT NULL,
image_username VARCHAR(255) NOT NULL,
image_filename VARCHAR(255) NOT NULL DEFAULT "",
image_date DATE NOT NULL,
PRIMARY KEY (image_id)
)
ENGINE=MyISAM';
mysql_query($query, $db) or die (mysql_error($db));
echo "Images table successfully created.";
?>
upload_image.php

Code: Select all

<?php
$db = mysql_connect("localhost","root","") or
die ("Unable to connect. Check your connection parameters.");
mysql_select_db("moviesite", $db) or die(mysql_error($db));
?>
<!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>upload_image</title>
</head>

<body>
<form action="check_image.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td> Your Username </td>
<td> <input type="text" name="username"/> </td>
</tr>
<td> Upload Image* </td>
<td> <input type="file" name="uploadfile"/> </td>
</tr> <tr>
<td colspan="2">
<small> <em> * Acceptable image formats include: GIF, JPG/JPEG and PNG.
</em> </small>
</td>
</tr> <tr>
<td> Image Caption <br/>
</td>
<td> <input type="text" name="caption" /> </td>
</tr > <tr>
<td colspan="2" style="text-align: center">
<input type="submit" name="submit" value="Upload"/>
</td>
</tr>
</table>
</form>
</body>
</html>
check_image.php

Code: Select all

<?php
$db = mysql_connect("localhost","root","") or
die ("Unable to connect. Check your connection parameters.");
mysql_select_db("moviesite", $db) or die(mysql_error($db));

//change this path to match your images directory
$dir ="C:/xampp/htdocs/WroxPhp6.0/img";
//make sure the uploaded file transfer was successful

if ($_FILES["uploadfile"]["error"] != UPLOAD_ERR_OK) {
switch ($_FILES["uploadfile"]["error"]) {
case UPLOAD_ERR_INI_SIZE:
die("The uploaded file exceeds the upload_max_filesize directive " .
"in php.ini.");
break;
case UPLOAD_ERR_FORM_SIZE:
die("The uploaded file exceeds the MAX_FILE_SIZE directive that " .
"was specified in the HTML form.");
break;
case UPLOAD_ERR_PARTIAL:
die("The uploaded file was only partially uploaded.");
break;
case UPLOAD_ERR_NO_FILE:
die("No file was uploaded.");
break;
case UPLOAD_ERR_NO_TMP_DIR:
die("The server is missing a temporary folder.");
break;
case UPLOAD_ERR_CANT_WRITE:
die("The server failed to write the uploaded file to disk.");
break;
case UPLOAD_ERR_EXTENSION:
die("File upload stopped by extension.");
break;
}
}
//get info about the image being uploaded
$uploadfile = $_POST["uploadfile"];
$image_caption = $_POST["caption"];
$image_username = $_POST["username"];
$image_date = date("Y-m-d");
list($width, $height, $type, $attr) = getimagesize($_FILES["uploadfile"]["tmp_name"]);
// make sure the uploaded file is really a supported image
switch ($type) {
case IMAGETYPE_GIF:
$image = imagecreatefromgif($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".gif";
break;
case IMAGETYPE_JPEG:
$image = imagecreatefromjpeg($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".jpg";
break;
case IMAGETYPE_PNG:
$image = imagecreatefrompng($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".png";
break;
default:
die("The file you uploaded was not a supported filetype.");
}
//insert information into image table
$query = "INSERT INTO images (image_caption, image_username, image_date)
VALUES ('$image_caption.', '$image_username', '$image_date')";
$result = mysql_query($query, $db) or die (mysql_error($db));
//retrieve the image_id that MySQL generated automatically when we inserted
//the new record
$last_id = mysql_insert_id();
//because the id is unique, we can use it as the image name as well to make
//sure we don’t overwrite another image that already exists
$imagename = $last_id.$ext;
// update the image table now that the final filename is known.
$query = "UPDATE images SET image_filename = '$imagename'
WHERE image_id = '$last_id'";
$result = mysql_query($query, $db) or die (mysql_error($db));
//save the image to its final destination
switch ($type) {
case IMAGETYPE_GIF:
imagegif($image, $dir . '/' . $imagename);
break;
case IMAGETYPE_JPEG:
imagejpeg($image, $dir . '/' . $imagename, 100);
break;
case IMAGETYPE_PNG:
imagepng($image, $dir . '/' . $imagename);
break;
}
imagedestroy($image);
?>
<!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>Here's your pic</title>
</head>
<body>
<h1> So how does it feel to be famous? </h1 >
<p> Here is the picture you just uploaded to our servers: </p >
<table>
<tr> <td> Image Saved as: </td> <td> <img src="img/<?php $imagename; ?>" style="float:left;"> </td> </tr>
<tr> <td> Image Type: </td> <td> <?php echo $ext; ?> </td> </tr>
<tr> <td> Height: </td> <td> <?php echo $height; ?> </td > </tr>
<tr> <td> Width: </td> <td> <?php echo $width; ?> </td > </tr>
<tr> <td> Upload Date: </td > <td > <?php echo $image_date; ?> </td > </tr>
</table>
</body>
</html>
Could some1 kindly help me point out why the uploaded image shows "X" instead of the uploaded image?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Image Upload in php 6.0

Post by Jonah Bron »

After you try to upload a picture, right-click > View source and post here the address in the <img> tag.

What does PHP 6 have to do with this? As far as I know, it's nowhere near being released.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Image Upload in php 6.0

Post by John Cartwright »

Jonah Bron wrote:After you try to upload a picture, right-click > View source and post here the address in the <img> tag.

What does PHP 6 have to do with this? As far as I know, it's nowhere near being released.
As far as I know the PHP6 branch was removed, and there is no pending release date on the next version, be it 5.4 or 6.0.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Image Upload in php 6.0

Post by Jonah Bron »

John Cartwright wrote:
Jonah Bron wrote:After you try to upload a picture, right-click > View source and post here the address in the <img> tag.

What does PHP 6 have to do with this? As far as I know, it's nowhere near being released.
As far as I know the PHP6 branch was removed, and there is no pending release date on the next version, be it 5.4 or 6.0.
Yeah, that invoked my curiosity, so I googled it. Here's what I found if anybody's interested.

http://stackoverflow.com/questions/2610 ... p-on-php-6
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Image Upload in php 6.0

Post by requinix »

If check_image.php isn't in the WroxPhp6.0 directory...
tobimichigan
Forum Commoner
Posts: 48
Joined: Sun May 10, 2009 1:35 pm

Re: Image Upload in php 6.0

Post by tobimichigan »

I'm presently battling with this code in chapter7 of wrox's php 6.0 regarding images. The problem is that both the source code I downloaded from wrox's official website and the one I manually lifed from the chapter 7 page pages is not displaying the image on any browser but an "X" figure.

The only difference is that the manually lifted code is inserting the sql query into all the fields of the image table; while the source code from the wrox's website isn't.
Below are excerpts:

Code from Wrox (I only modifed the image directories as I commented.

1. Table in use:

Code: Select all

<?php
$db = mysql_connect('localhost', 'bp6am', 'bp6ampass') or 
    die ('Unable to connect. Check your connection parameters.');
mysql_select_db('moviesite', $db) or die(mysql_error($db));

//create the images table
$query = 'CREATE TABLE images (
        image_id       INTEGER      NOT NULL AUTO_INCREMENT,
        image_caption  VARCHAR(255) NOT NULL,
        image_username VARCHAR(255) NOT NULL,
        image_filename VARCHAR(255) NOT NULL DEFAULT "",
        image_date     DATE         NOT NULL,
        PRIMARY KEY (image_id)
    )
    ENGINE=MyISAM';
mysql_query($query, $db) or die (mysql_error($db));

echo 'Images table successfully created.';
?>
2. upload_image.php

Code: Select all

<html>
 <head>
  <title>Upload your pic to our site!</title>
  <style type="text/css">
  <!--
td {vertical-align: top;}
  -->
  </style>
 </head>
 <body>
  <form action="check_image.php" method="post" enctype="multipart/form-data">
   <table>
    <tr>
     <td>Your Username</td>
     <td><input type="text" name="username" /></td>
    </tr>
     <td>Upload Image*</td>
     <td><input type="file" name="uploadfile" /></td>
    </tr><tr>
     <td colspan="2">
      <small><em>* Acceptable image formats include: GIF, JPG/JPEG and PNG.
       </em></small>
     </td>
    </tr><tr>
     <td>Image Caption<br/>
     </td>
     <td><input type="text" name="caption" /></td>
    </tr><tr>
     <td colspan="2" style="text-align: center">
      <input type="submit" name="submit" value="Upload"/>
     </td>
    </tr>
   </table>
  </form>
 </body>
</html>
3.check_image.php (this 1 does not insert image_filename into the image table)

Code: Select all

<?php
//connect to MySQL
$db = mysql_connect('localhost', 'root', '') or 
    die ('Unable to connect. Check your connection parameters.');
mysql_select_db('moviesite', $db) or die(mysql_error($db));

//change this path to match your images directory from the text
//$dir ='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images';
$dir='C:/xampp/htdocs/WroxPhp6.0/Ch07';//this is the 1st thing I changed

//change this path to match your thumbnail directory
$thumbdir = $dir . '/thumbs';

//change this path to match your fonts directory and the desired font
putenv('GDFONTPATH=' . 'C:/Windows/Fonts');
$font = 'arial';

// handle the uploaded image
if ($_POST['submit'] == 'Upload') {

    //make sure the uploaded file transfer was successful
    if ($_FILES['uploadfile']['error'] != UPLOAD_ERR_OK)
    {
        switch ($_FILES['uploadfile']['error']) {
        case UPLOAD_ERR_INI_SIZE:
            die('The uploaded file exceeds the upload_max_filesize directive ' .
                'in php.ini.');
            break;
        case UPLOAD_ERR_FORM_SIZE:
            die('The uploaded file exceeds the MAX_FILE_SIZE directive that ' .
                'was specified in the HTML form.');
            break;
        case UPLOAD_ERR_PARTIAL:
            die('The uploaded file was only partially uploaded.');
            break;
        case UPLOAD_ERR_NO_FILE:
            die('No file was uploaded.');
            break;
        case UPLOAD_ERR_NO_TMP_DIR:
            die('The server is missing a temporary folder.');
            break;
        case UPLOAD_ERR_CANT_WRITE:
            die('The server failed to write the uploaded file to disk.');
            break;
        case UPLOAD_ERR_EXTENSION:
            die('File upload stopped by extension.');
            break;
        }
    }
    
    //get info about the image being uploaded
    $image_caption = $_POST['caption'];
    $image_username = $_POST['username'];
    $image_date = @date('Y-m-d');
    list($width, $height, $type, $attr) =
        getimagesize($_FILES['uploadfile']['tmp_name']);

    // make sure the uploaded file is really a supported image
    $error = 'The file you uploaded was not a supported filetype.';
    switch ($type) {
    case IMAGETYPE_GIF:
        $image = imagecreatefromgif($_FILES['uploadfile']['tmp_name']) or
            die($error);
        break;
    case IMAGETYPE_JPEG:
        $image = imagecreatefromjpeg($_FILES['uploadfile']['tmp_name']) or
            die($error);
        break;
    case IMAGETYPE_PNG:
        $image = imagecreatefrompng($_FILES['uploadfile']['tmp_name']) or
            die($error);
        break;
    default:
        die($error);
    }

    //insert information into image table
    $query = "INSERT INTO images (image_caption, image_username, image_date)
VALUES ('$image_caption', '$image_username', '$image_date')";
$result = mysql_query($query, $db) or die (mysql_error($db));
    
    //retrieve the image_id that MySQL generated automatically when we inserted
    //the new record
    $last_id = mysql_insert_id();
    
    // save the image to its final destination
    $image_id = $last_id;
    imagejpeg($image, $dir . '/' . $image_id  . '.jpg');
    imagedestroy($image);

} else {
    // retrieve image information
    $query = 'SELECT
        image_id, image_caption, image_username, image_date
    FROM
        images
    WHERE
        image_id = ' . $_POST['id'];
    $result = mysql_query($query, $db) or die (mysql_error($db));
    extract(mysql_fetch_assoc($result));

    list($width, $height, $type, $attr) = getimagesize($dir . '/' . $image_id .
        '.jpg');
}

if ($_POST['submit'] == 'Save') {
    // make sure the requested image is valid
    if (isset($_POST['id']) && ctype_digit($_POST['id']) &&
        file_exists($dir . '/' . $_POST['id'] . '.jpg')) {
        $image = imagecreatefromjpeg($dir . '/' . $_POST['id'] . '.jpg');
    } else {
        die('invalid image specified');
    }

    // apply the filter    
    $effect = (isset($_POST['effect'])) ? $_POST['effect'] : -1;
    switch ($effect) {
    case IMG_FILTER_NEGATE:
        imagefilter($image, IMG_FILTER_NEGATE); 
        break;
    case IMG_FILTER_GRAYSCALE:
        imagefilter($image, IMG_FILTER_GRAYSCALE); 
        break;
    case IMG_FILTER_EMBOSS:
        imagefilter($image, IMG_FILTER_EMBOSS); 
        break;
    case IMG_FILTER_GAUSSIAN_BLUR:
        imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
        break;
    }

    // add the caption if requested
    if (isset($_POST['emb_caption'])) {
        imagettftext($image, 12, 0, 20, 20, 0, $font, $image_caption);
    }

    //add the logo watermark if requested
    if (isset($_POST['emb_logo'])) {
        // determine x and y position to center watermark
        list($wmk_width, $wmk_height) = getimagesize('images/logo.png');
        $x = ($width - $wmk_width) / 2;
        $y = ($height - $wmk_height) / 2;
    
        $wmk = imagecreatefrompng('images/logo.png');
        imagecopymerge($image, $wmk, $x, $y, 0, 0, $wmk_width, $wmk_height, 20);
        imagedestroy($wmk);
    }

    // save the image with the filter applied
    imagejpeg($image, $dir . '/' . $_POST['id'] . '.jpg', 100);

    //set the dimensions for the thumbnail
    $thumb_width = $width * 0.10;
    $thumb_height = $height * 0.10;

    //create the thumbnail
    $thumb = imagecreatetruecolor($thumb_width, $thumb_height);
    imagecopyresampled($thumb, $image, 0, 0, 0, 0, $thumb_width, $thumb_height,
        $width, $height);
    imagejpeg($thumb, $dir . '/' . $_POST['id'] . '.jpg', 100);
    imagedestroy($thumb);
?>
<html>
 <head>
  <title>Here is your pic!</title>
 </head>
 <body>
  <h1>Your image has been saved!</h1>
  <img src="WroxPhp6.0/Ch07/<?php echo $_POST['id']; ?>.jpg" /><?php echo//here I changed the directory to my localhost ?>
 </body>
</html>
<?php
} else {
?>
<html>
 <head>
  <title>Here is your pic!</title>
 </head>
 <body>
  <h1>So how does it feel to be famous?</h1>
  <p>Here is the picture you just uploaded to our servers:</p>
<?php 
   if ($_POST['submit'] == 'Upload') {
       $imagename = 'WroxPhp6.0/Ch07/' . $image_id  . '.jpg';//here I also changed the directory to my localhost (WroxPhp6.0/Ch07 dir)
   } else {
       $imagename = 'image_effect.php?id=' . $image_id  . '&e=' .
           $_POST['effect'];

       if (isset($_POST['emb_caption'])) {
           $imagename .= '&capt=' . urlencode($image_caption); 
       }

       if (isset($_POST['emb_logo'])) {
           $imagename .= '&logo=1'; 
       }
   }
?>
   <img src="WroxPhp6.0/Ch07<?php echo $imagename; ?>" style="float:left;">
  <table>
   <tr><td>Image Saved as: </td><td><?php echo $image_id  . '.jpg'; ?></td></tr>
   <tr><td>Height: </td><td><?php echo $height; ?></td></tr>
   <tr><td>Width: </td><td><?php echo $width; ?></td></tr>
   <tr><td>Upload Date: </td><td><?php echo $image_date; ?></td></tr>
  </table>
  <p>You may apply special options to your image below. Note: saving an image
with any of the options applied  <em>cannot be undone</em>.</p>
  <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
   <div>
    <input type="hidden" name="id" value="<?php echo $image_id;?>"/>
    Filter: <select name="effect">
     <option value="-1">None</option>
<?php
    echo '<option value="' . IMG_FILTER_GRAYSCALE . '"';
    if (isset($_POST['effect']) && $_POST['effect'] == IMG_FILTER_GRAYSCALE) {
        echo ' selected="selected"';
    }
    echo '>Black and White</option>';

    echo '<option value="' . IMG_FILTER_GAUSSIAN_BLUR . '"';
    if (isset($_POST['effect']) && $_POST['effect'] ==
        IMG_FILTER_GAUSSIAN_BLUR) {
        echo ' selected="selected"';
    }
    echo '>Blur</option>';

    echo '<option value="' . IMG_FILTER_EMBOSS . '"';
    if (isset($_POST['effect']) && $_POST['effect'] == IMG_FILTER_EMBOSS) {
        echo ' selected="selected"';
    }
    echo '>Emboss</option>';

    echo '<option value="' . IMG_FILTER_NEGATE . '"';
    if (isset($_POST['effect']) && $_POST['effect'] == IMG_FILTER_NEGATE) {
        echo ' selected="selected"';
    }
    echo '>Negative</option>';
?>
    </select>
    <br/><br/>
<?php
    echo '<input type="checkbox" name="emb_caption"';
    if (isset($_POST['emb_caption'])) {
        echo ' checked="checked"';
    }
    echo '>Embed caption in image?';
    echo '<br/><br/><input type="checkbox" name="emb_logo"';
    if (isset($_POST['emb_logo'])) {
        echo ' checked="checked"';
    }
    echo '>Embed watermarked logo in image?';
?>
    <br/><br/>
    <input type="submit" value="Preview" name="submit" />
    <input type="submit" value="Save" name="submit" />
   </div>
  </form>
 </body>
</html>
<?php
}
?>

4.Manually lifted code

check_image.php (this 1 inserts image_filename into the image table)

Code: Select all

<?php
$db = mysql_connect("localhost","root","") or
die ("Unable to connect. Check your connection parameters.");
mysql_select_db("moviesite", $db) or die(mysql_error($db));

//change this path to match your images directory
$dir ="C:/xampp/htdocs/WroxPhp6.0/Ch07/manual";
//make sure the uploaded file transfer was successful

if ($_FILES["uploadfile"]["error"] != UPLOAD_ERR_OK) {
switch ($_FILES["uploadfile"]["error"]) {
case UPLOAD_ERR_INI_SIZE:
die("The uploaded file exceeds the upload_max_filesize directive " .
"in php.ini.");
break;
case UPLOAD_ERR_FORM_SIZE:
die("The uploaded file exceeds the MAX_FILE_SIZE directive that " .
"was specified in the HTML form.");
break;
case UPLOAD_ERR_PARTIAL:
die("The uploaded file was only partially uploaded.");
break;
case UPLOAD_ERR_NO_FILE:
die("No file was uploaded.");
break;
case UPLOAD_ERR_NO_TMP_DIR:
die("The server is missing a temporary folder.");
break;
case UPLOAD_ERR_CANT_WRITE:
die("The server failed to write the uploaded file to disk.");
break;
case UPLOAD_ERR_EXTENSION:
die("File upload stopped by extension.");
break;
}
}
//get info about the image being uploaded
$uploadfile = $_POST["uploadfile"];
$image_caption = $_POST["caption"];
$image_username = $_POST["username"];
$image_date = date("Y-m-d");
list($width, $height, $type, $attr) = getimagesize($_FILES["uploadfile"]["tmp_name"]);
// make sure the uploaded file is really a supported image
switch ($type) {
case IMAGETYPE_GIF:
$image = imagecreatefromgif($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".gif";
break;
case IMAGETYPE_JPEG:
$image = imagecreatefromjpeg($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".jpg";
break;
case IMAGETYPE_PNG:
$image = imagecreatefrompng($_FILES["uploadfile"]["tmp_name"]) or
die("The file you uploaded was not a supported filetype.");
$ext = ".png";
break;
default:
die("The file you uploaded was not a supported filetype.");
}
//insert information into image table
$query = "INSERT INTO images (image_caption, image_username, image_date)
VALUES ('$image_caption.', '$image_username', '$image_date')";
$result = mysql_query($query, $db) or die (mysql_error($db));
//retrieve the image_id that MySQL generated automatically when we inserted
//the new record
$last_id = mysql_insert_id();
//because the id is unique, we can use it as the image name as well to make
//sure we don’t overwrite another image that already exists
$imagename = $last_id.$ext;
// update the image table now that the final filename is known.
$query = "UPDATE images SET image_filename = '$imagename'
WHERE image_id = '$last_id'";
$result = mysql_query($query, $db) or die (mysql_error($db));
$sel=mysql_query("select * from images where image_filename='$imagename'");
$res=mysql_fetch_array($sel);
$image_filename=$res['image_filename'];
//save the image to its final destination
switch ($type) {
case IMAGETYPE_GIF:
imagegif($image, $dir . '/' . $imagename);
break;
case IMAGETYPE_JPEG:
imagejpeg($image, $dir . '/' . $imagename, 100);
break;
case IMAGETYPE_PNG:
imagepng($image, $dir . '/' . $imagename);
break;
}
imagedestroy($image);
?>
<!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>Here's your pic</title>
</head>
<body>
<h1> So how does it feel to be famous? </h1 >
<p> Here is the picture you just uploaded to our servers: </p >
<img src="WroxPhp6.0/Ch07/manual/<?php echo $imagename; ?>; ?>" style="float:left;">
<table>
<tr> <td> Image Saved as: </td> <td><?php echo $imagename; ?></td> </tr>
<tr> <td> Image Type: </td> <td> <?php echo $ext; ?> </td> </tr>
<tr> <td> Height: </td> <td> <?php echo $height; ?> </td > </tr>
<tr> <td> Width: </td> <td> <?php echo $width; ?> </td > </tr>
<tr> <td> Upload Date: </td > <td > <?php echo $image_date; ?> </td > </tr>
</table>
</body>
</html>
Btw: Php 6.0 indicated here in this thread refers to vantage codes in php 6.0 release...
Please can any1 kindly tell why this code is not displaying the actual uploaded image?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Image Upload in php 6.0

Post by requinix »

tobimichigan wrote:Btw: Php 6.0 indicated here in this thread refers to vantage codes in php 6.0 release...
Regardless of what it's supposed to refer to, there is no PHP 6. Not even plans for it.


1. What's the HTML source for the page that displays the image?
2. What images are in the upload directory?
Post Reply