I can check a simple variable if it's empty or not. But how do i check the array value which is come from Html Upload Form. Like: name=images[];
Simple variable check:
if(empty($somevalue))
$err[] = "your variable is empty";
But how do i check if it's something like this:
<input name="images[]" type="file"/>
Update Code:
<?php
if(isset($_POST['Submit']) && $_POST['Submit'] == "Save & Continue")
{
$number_of_file_fields = 0;
$number_of_uploaded_files = 0;
$number_of_moved_files = 0;
$uploaded_files = array();
$upload_directory = dirname(__file__) . '/uploaded/'; //set upload directory
$img[] = $_FILES['images']['name'];
$img = array();
$err = array();
if(isset($img))
{
if(empty($img))
$err[] = "Your property picture require";
}
if(!empty($err))
{
foreach($err as $er)
{
echo $er;
}
}
else
{
echo "done";
}
}
?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data"
name="mutiple_file_upload_form" id="mutiple_file_upload_form">
<table width="1020" border="0" cellspacing="7" cellpadding="0">
<tr>
<td valign="top" width="250">
Upload your property pictures
</td>
<td>
<div id="file_container">
<input name="images[]" type="file" class="tr2" />
<br />
</div>
<a href="javascript:void(0);" onClick="add_file_field();">Add another</a><br />
<input type="submit" value="Save & Continue" name="Submit" class="submit" />
</td>
</tr>
</table>
</form>
</table>