could you please do us all a favor and
1.) break that character salad into some shorter strings to make that thread readable again on < 30" monitors - or just post the first 50 or so characters, since i dont think that anyone will be able to unconvert this anyways. it sure looks like some binary image code, when the headers are sent incorrectly.
2.) post the complete code (or the full snippet).
there are at least 2 brackets missing, as you have it now
define ("FILE_DIR", "_images/right_thing/");
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
if ($_FILES['imageupload']['type'] == "image/gif" OR
$_FILES['imageupload']['type'] == "image/pjpeg" OR
$_FILES['imageupload']['type'] == "image/jpeg") {
echo "Pictures Must Be in .JPG Format!";
}
else {
$newname = $_POST['title'];
//Resize the image
$filedir = "/_images/right_thing/";
$uploadedfile = $_FILES['file']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
list($width, $height)= getimagesize($uploadedfile);
$newwidth= 100;
$newheight=($height/$width)*100;
$tmp = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($tmp, $src, 0,0,0,0, $newwidth, $newheight, $width, $height);
$filename = $_FILES['file']['name'];
imagejpeg($tmp, $newphoto, 100);
$result = move_uploaded_file ($newphoto,FILE_DIR."/$newname.jpg") or
die("error uploading photo");
imagedestroy($src);
imagedestroy($tmp);
//Insert Information Into Database
if ($result == 1) {
$query = "INSERT INTO Right_thing (
date,
title,
teaser,
content,
image,
status,
submitted_by,
email
)
VALUES (
'$date',
'$title',
'$teaser',
'$content',
'$title',
'Pending',
$submitted_by,
$email
);";
$result = mysql_query($query) or die ("couldn't add entry");
echo "File Successfuly Uploaded.";
}
else {
echo "There was problem uploading the file";
}
then, i somewhat fail to see what you are trying to do here:
if ($_FILES['imageupload']['type'] == "image/gif" OR
$_FILES['imageupload']['type'] == "image/pjpeg" OR
$_FILES['imageupload']['type'] == "image/jpeg") {
echo "Pictures Must Be in .JPG Format!";
}
it just seems like there is a quirk in the logic of this statement.