Hey all, on this script I have just inputted some information to a database and then I go onto checking the images to check if I can accept the file type. The only thig is I deliberatly put in a pdf fiel and it doesn't stop it going through. Does anyone know why. P.S Sorry for posting twice so soon.
<?php
if ($photo1 or $photo2 or $photo3 or $photo4 or $photo5 or $photo6 != NULL)
{
$getid=mysql_query("select id from classifieds where description='$description' && title='$title'");
while ($row=mysql_fetch_array($getid))
{
$id=$row[id];
}
$i=0;
while ($i<6)
{
$i++;
$photo=photo;
$photo.=$i;
if ( is_uploaded_file ( $HTTP_POST_FILES[$photo]['tmp_name']) ) {
$imagetype=$HTTP_POST_FILES[$photo]['type'];
print "<script> alert('$imagetype') </script>";
if ( $imagetype == 'image/pjpeg' || 'image/gif ') {}
else { $error="One or more of your image types were unsupported"; }
}
}
if ($error==NULL)
{
mysql_query(" insert into classphotos(id, photo1, photo2, photo3, photo4, photo5, photo6) values ('$id','$photo1','$photo2',
$photo3','$photo4','$photo5','$photo6') ");
}
}
?>
Thanks in advance!