Question : process a form that have empty textboxes

form.html
image.php

one of the text fields may be empty

I still want to process the form if one or both fields is empty

1:
2:
3:
4:
5:
<form action="image.php" method="POST" enctype="multipart/form-data">
<input type="file" name="myfile" style="width:700px;" >
<input type="file" name="manu" style="width:700px;" >
<input type="submit" value="upload">
</form>
1:
2:
3:
4:
5:
6:
7:
8:
9:
<?
$name= $_FILES["myfile"]["name"];
$temp= $_FILES["myfile"]["tmp_name"]; 
move_uploaded_file($temp,$name);

$name= $_FILES["manu"]["name"];
$temp= $_FILES["manu"]["tmp_name"];
move_uploaded_file($temp,"manu".$name);
?>

Answer : process a form that have empty textboxes

Hello somersetit,

1_ A service layer in your case should provide a thin facade to your domain model to provide an interface for your service layer clients. How you organize your domain model objects is really up to you but it would make sense to keep it simple as possible.

2_ Very often there is a one to one mapping between these  and again this would make your like easier.

3_ I like using forms that live at the top level of the application and have written classes that can dynamically generate these for models based on table gateways and information stored about them.

4_ I look at ACL as a way to implement business rules over resources for access by clients (A Model).  Keeping the service layer as thin as possible comes back to my first point. You call the ACL from your controllers to determine if a client which has an assigned role has the required permission to to the requested resource and act appropriately,

I hope this helps.

Joseph Melnick  
Random Solutions  
 
programming4us programming4us