Ok, I have a upload script that I created by hand, and the script works for the most part. All the info ends up in my database. The part that is not working is the image upload. will someone check this code out and tell me if I am doing something wrong. Thanks in advanced.
if ($_FILES['thumb']['tmp_name'] != '')
{
if (is_uploaded_file($_FILES['thumb']['tmp_name']))
{
if (($_FILES['thumb']['type']=="image/gif") || ($_FILES['thumb']['type']=="image/pjpeg") || ($_FILES['thumb']['type']=="image/jpeg"))
{
$imagesize = getimagesize($_FILES['thumb']['tmp_name']);
$path = "/home/graphics/public_html/brushes/thumbs/";
if (($imagesize[0] != "45") || ($imagesize[1] != "45"))
{
$errorimage = "The image you are trying to upload is not 45px X 45px. Use the back button to go back and upload a new image.";
echo $errorimage;
exit;
}else{
if ($_FILES['thumb']['type']=="image/gif"){
$ext = 'gif';}
if ($_FILES['thumb']['type']=="image/pjpeg"){
$ext = 'jpg';}
if ($_FILES['thumb']['type']=="image/jpeg"){
$ext = 'jpg';}
$newfilename = $title . "_". md5(microtime() . $HTTP_SERVER_VARS['REMOTE_ADDR']) . '.' . $ext;
$res = move_uploaded_file($_FILES['thumb']['tmp_name'], $path . $newfilename);
if (!$res)
{
$errorimage = "There was a problem while trying to upload your image.";
echo $errorimage;
exit;
}
}
}else{
$errorimage = "There was a problem while trying to upload your image.";
echo $errorimage;
exit;
}
}else{
$errorimage = "There was a problem while trying to upload your image.";
echo $errorimage;
exit;
}
}