Im having a upload image function. its optional so when a user submits without selecting a image it should neglect it and not process uploading it. My check fails and the page tris to upload.
Below is my image upload form page:
Code: Select all
<form name="Confirm" method="post" action="Itemid=395.php" enctype="multipart/form-data" onSubmit="return check_project();">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="183" class='tblTD tblBT tblBL tblBR'>Upload Project Picture</td>
<td width="467" class='tblTD tblBT tblBR'><label><input name="vImage" type="file"></label> </td>
</tr>
<tr>
<td colspan="2" align="center" class='tblTD'>
<input type="image" src='<?=$mosConfig_live_site?>/images/proj_Add.gif' alt='Add New Project' border='0' />
</tr>
</table>
</form>
Code: Select all
if($_FILES['vImage']!="" || $_FILES['vImage']!=" " || $_POST['vImage']!="" || $_POST['vImage']!=" "){
//Upload image code
}
Any ideas how to avod this...
thanks guys