<?php
 
if(isset($_FILES['image']) AND is_array($_FILES['image']) AND $_FILES['image']['error'] == 0){
 
    require_once("SafelyUpload.php"); // Require SafelyUpload PHP class
 
    $upload    =    new SafelyUpload($_FILES['image'],"uploads",75);
 
    $upload->resize(400);    // Optional !! Resize to width = 600  if width > height || Height = 600 if height > width
 
    if( $upload->upload() ){
 
        echo"Photo uploaded successfully<br /><img src=\"".$upload->new_name."\" />";
 
    }
 
    else{
 
        echo $upload->error;
 
    }
 
}
 
else{
 
    echo"You're welcome only from <a href=\"form.html\">form.html</a>";
 
}
 
?>
 
 |