Am i using this right. I get this error.
Warning: getimagesize: Unable to open '' for reading. in /usr/www/users/shafey7s/baintown/admin/news/add_news_done.php on line 21
Warning: getimagesize: Unable to open '' for reading. in /usr/www/users/shafey7s/baintown/admin/news/add_news_done.php on line 22
$imagesource=$HTTP_POST_FILES['image']['tmp_name'];
$dest="../news_images/tmp";
$imagename="_FILES['userfile']['name']";
switch ($mode){
case check:
?>
<table border=3 width=750 cellpadding=7>
<tr>
<td bgcolor="#0099FF">Add news: Approve</td>
</tr>
<tr><td><FORM ACTION="add_news_done.php?mode=approve" METHOD="POST" ENCTYPE="multipart/form-data">
<table border=0 cellspacing=0 cellpadding=0><tr>
<td valign="top">
<?
$imageInfo = getimagesize($imagesource);
if (getimagesize($imagesource) > 77000)
{
$error='<BR><FONT COLOR="RED">ERROR:</FONT> File not supplied, or file too big.<br>Please try again with a smaller file.<br>(Under 70k maximum, although files of 35k or less are preferred.)<BR>';
} elseif ($imageInfo[0] < 375) {
$error='<BR><FONT COLOR="RED">ERROR:</FONT> Image is '.$imagesize[0].' pixels high. Images must be 375 pixels wide by 281 pixels high.<BR>';
} elseif ($imageInfo[1] < 281) {
$error='<BR><FONT COLOR="RED">ERROR:</FONT> Image is '.$imagesize[1].' pixels high. Images must be 375 pixels wide by 281 pixels high.<BR>';
} elseif (filetype($imagesource) != 'jpg') {
$error='<BR><FONT COLOR="RED">ERROR:</FONT> Image is not a JPG. It must be a JPG.<BR>';
}
else
{
if(move_uploaded_file($imagesource,$dest)){
echo'File uploaded. If this image is correct, enter a caption below and then click "approve". Otherwise, <a href="../index.php">click here</a> to start over.
<table border="1" width="770">
<tr>
<td height="6" valign="top" width="260" class="text"> Date: </td>
<td width="260"><? echo $date;?></td>
</tr>
<tr>
<td valign="top" width="260" class="text"> Title: </td>
<td width="260"><? echo $title;?></td>
</tr>
<tr>
<td valign="top" width="260" class="text">Teaser: </td>
<td width="260"><? echo $teaser;?></td>
</tr>
<tr>
<td width="260" class="text">News</td>
<td rowspan="2" width="260"><? echo $text ;?></td>
</tr>
</table>
<br>
<p>
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Approve"></td><td> </td>
</tr></table> </td>
</tr></table><br></FORM>';