Friday 16 May 2014

File Uploading in PHP

<?php

if (isset($_POST['submit']))
{


if($_FILES['easyfile']['name'])
{
    //if no errors...
    if(!$_FILES['easyfile']['error'])
    {
   
    //here is file destils
   
    echo "<pre>";
    print_r($_FILES);
    echo "</pre>";
   
   
    }
}

}// if submit button is hit

?>


<form action="" method="post" enctype="multipart/form-data">
    Your file: <input type="file" name="easyfile" size="40" />
    <input type="submit" name="submit" value="Submit" />
</form>

No comments :

Post a Comment

Freelance Jobs