Philip D Heady wrote:
What is with this error message?????? First part validates, second part
fails...
getimagesize (filename...) failed to open stream: No such file or directory
} elseif ($photo) {
$ext = strtolower(substr($photo, -3));
if ($ext == "peg") { $ext = "jpg"; }
if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "bmp" )
{
$focus = "photo";
$msg2 = "Please provide a valid gif, jpeg, or bmp photo or do not
attach one.";
} else {
$size = getimagesize($photo);
if ($size > 25000) {
$msg2 = "Photo must be smaller than 25k.";
}}}
What is $photo? It should be a URL or a path to a file (either absolute or
relative). However, if you get it working, you'll run into a problem with the
next line. First, getimagesize() returns an array. Second, none of the
elements in the array relate to filesize. They relate to it's type, height and
width.
http://ca.php.net/manual/en/function.getimagesize.php
You should read about filesize():
http://ca.php.net/manual/en/function.filesize.php
Or if this is a file the user has uploaded, try using:
$_FILES['photo']['size']
http://ca.php.net/features.file-upload
Shawn
--
Shawn Wilson
sh***@glassgiant.com http://www.glassgiant.com