Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Uploader {
- public $myimage;
- public function __construct ($myimage) {
- $this->myimage = $_FILES['myimage'];
- }
- public function isUploaded() {
- if (isset($this->myimage)) {
- if (0 == $this->myimage['error']) {
- return true;
- }
- }
- }
- public function upload() {
- if ( public function isUploaded() ) {
- move_uploaded_file(
- $this->myimage['tmp_name'],
- __DIR__ . '/images/uploaded.jpeg'
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement