<?php 
include('config.php'); 
//var_dump($_POST); 
$allimages = ''; 
if($_FILES["file"]["name"] != '') 
{ 
    $test = explode('.', $_FILES["file"]["name"]); 
    $ext = end($test); 
    $name = rand(10000, 99999999) . '.' . $ext; 
    $location = 'uploads/' . $name; 
    move_uploaded_file($_FILES["file"]["tmp_name"], $location); 
   // echo '<img src="'.$location.'" height="150" width="225" class="img-thumbnail" />'; 
    echo $location; 
 
}
 
 |