topical media & game development
basic-php-07-check-image-rev01.php / php
<?php
//connect to the database
link)
or die (mysql_error());
//make variables available
_POST['image_caption'];
_POST['image_username'];
_FILES['image_filename']['name'];
ImageDir ="c:/Program Files/Apache Group/Apache2/test/images/";
ImageDir . _FILES['image_filename']['tmp_name'],
width, type, ImageName);
switch (ext = ".gif";
break;
case 2:
ext = ".png";
break;
default:
echo "Sorry, but the file you uploaded was not a GIF, JPG, or " .
"PNG file.<br>";
echo "Please hit your browser's 'back' button and try again.";
}
//insert info into image table
image_caption', 'today')";
insert)
or die(mysql_error());
newfilename = lastpicid . ImageName, lastpicid . image_name; ?></strong><br>
This image is a <?php echo width; ?> pixels wide
and <?php echo today; ?>.
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.