Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. if (isset($_POST['submit_enquiry'])) {
  2. $enquiry = new Enquiry();
  3. $enquiry->newEnquiry($_POST, $_FILES);
  4. }
  5.  
  6. class Enquiry {
  7.  
  8. private function _processFiles($_FILES, $caseID) {
  9. ...
  10. }
  11.  
  12. private function _processForm($_POST) {
  13. ...
  14. }
  15.  
  16. public function newEnquiry($_POST, $_FILES) {
  17. $caseID = $this->_processForm($_POST); // returns caseID
  18. $this->_processFiles($_FILES, $caseID);
  19. }
  20. }
  21.  
  22. Array
  23. (
  24. [file] => Array
  25. (
  26. [name] => Array
  27. (
  28. [0] => Blue hills.jpg
  29. [1] => Sunset.jpg
  30. [2] =>
  31. )
  32.  
  33. [type] => Array
  34. (
  35. [0] => image/jpeg
  36. [1] => image/jpeg
  37. [2] =>
  38. )
  39.  
  40. [tmp_name] => Array
  41. (
  42. [0] => /tmp/phpwyLp86
  43. [1] => /tmp/phpKJa4iw
  44. [2] =>
  45. )
  46.  
  47. [error] => Array
  48. (
  49. [0] => 0
  50. [1] => 0
  51. [2] => 4
  52. )
  53.  
  54. [size] => Array
  55. (
  56. [0] => 28521
  57. [1] => 71189
  58. [2] => 0
  59. )
  60.  
  61. )
  62.  
  63. )
  64.  
  65. foreach($_FILES as $file){
  66. $file['name']=$_POST['enquiryID'].'_'.$_POST['userID'].'_'.$file['name'];
  67. }
  68.  
  69. // do upload
Add Comment
Please, Sign In to add comment