help. i finally put together a script to upload only .png IMAGE files that are under a certain filesize. BUT. is there any way i can only upload the image if its dimensions are exactly 55x55? heres what i have so far: (i want it always be named avi.png so only one image can be in the folder)
if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
$avisize=$_FILES['userfile']['size'];
$avitype=$_FILES['userfile']['type'];
$aviname=$_FILES['userfile']['name'];
$aviname="avi.png";
$avipath=$_SERVER["DOCUMENT_ROOT"] . "/" . $_SESSION[userfilefoldername] . "/" . $aviname;
if ($avisize<100000 && ereg("image", $avitype) && $_FILES[userfile][type] == "image/png")
{move_uploaded_file($_FILES['userfile']['tmp_name'],
$avipath);
$aviroot= "http://www.socialemo.com/$_SESSION[userfilefoldername]/";
$avipath2=$aviroot . $aviname;
echo "<h3>Your Image Link Here: </h3><a target="_blank" href='$avipath2'>$avipath2</a>";}
if ($avisize>100000)
{
echo "ERROR <br> the image size is too big";
}
if (!ereg("image", $avitype) )
{
echo "ERROR <br> the file is not image<br>";
}
if ($_FILES[userfile][type] != "image/png"){
echo "ERROR <br> the file is not .png must be a png image<br>";}
}