PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ljubo Bumbarov   Image Resizer   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Image Resizer
Change the size of uploaded image files
Author: By
Last change:
Date: 17 years ago
Size: 671 bytes
 

Contents

Class file image Download
<?php
if (isset ($_POST["submit"])) {

include (
"imageresizer.class.php");
       
           
$image = new Image($_FILES['file']['name']);
           
$image -> PicDir = "uploads/";
           
$image -> TmpName = $_FILES['file']['tmp_name'];
           
$image -> FileSize = $_FILES['file']['size'];
           
$image -> FileType = $_FILES['file']['type'];
       
       
//$image -> Save(); //use this if you wish images without resizing
       
$image -> Resize ();
    } else {
   
?>
<form name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method=post enctype="multipart/form-data">
<input type="file" name="file" size="40">
<input type="submit" name="submit" value="submit">
</form>
<?php
   
}
?>