Advertisement
SashaRaaa

Untitled

Jul 18th, 2018
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Uploader {
  2.  
  3. public $myimage;
  4.  
  5. public function __construct ($myimage) {
  6. $this->myimage = $_FILES['myimage'];
  7. }
  8.  
  9. public function isUploaded() {
  10.  
  11. if (isset($this->myimage)) {
  12.     if (0 == $this->myimage['error']) {
  13.     return true;
  14.     }
  15.     }
  16. }
  17.  
  18. public function upload() {
  19.     if ( public function isUploaded() ) {
  20.     move_uploaded_file(
  21.     $this->myimage['tmp_name'],
  22.     __DIR__ . '/images/uploaded.jpeg'
  23.     );
  24.    
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement