Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_POST['submit_enquiry'])) {
- $enquiry = new Enquiry();
- $enquiry->newEnquiry($_POST, $_FILES);
- }
- class Enquiry {
- private function _processFiles($_FILES, $caseID) {
- ...
- }
- private function _processForm($_POST) {
- ...
- }
- public function newEnquiry($_POST, $_FILES) {
- $caseID = $this->_processForm($_POST); // returns caseID
- $this->_processFiles($_FILES, $caseID);
- }
- }
- Array
- (
- [file] => Array
- (
- [name] => Array
- (
- [0] => Blue hills.jpg
- [1] => Sunset.jpg
- [2] =>
- )
- [type] => Array
- (
- [0] => image/jpeg
- [1] => image/jpeg
- [2] =>
- )
- [tmp_name] => Array
- (
- [0] => /tmp/phpwyLp86
- [1] => /tmp/phpKJa4iw
- [2] =>
- )
- [error] => Array
- (
- [0] => 0
- [1] => 0
- [2] => 4
- )
- [size] => Array
- (
- [0] => 28521
- [1] => 71189
- [2] => 0
- )
- )
- )
- foreach($_FILES as $file){
- $file['name']=$_POST['enquiryID'].'_'.$_POST['userID'].'_'.$file['name'];
- }
- // do upload
Add Comment
Please, Sign In to add comment