<?php
 //upload.php
if(isset($_FILES["file_url"]["name"]))
{
 $test = explode('.', $_FILES["file_url"]["name"]);
 $ext = end($test);
 $name = md5(rand(100000, 999999)) . '.' . $ext;
 $location = '../file_url/' . $name;  
 Array($_FILES["file_url"]["tmp_name"], $location);

 
// Start the session
session_start();
$_SESSION['file_url'] = $location;
session_write_close();

//  echo '<a href="'.$location.'" target="_blank">View File </a>';
 
    echo '<img src="'.$location.'" height="150" width="225" class="img-thumbnail" />';
 }


  //upload.php
if(isset($_FILES["solution-file"]["name"]))
{
 $test = explode('.', $_FILES["solution-file"]["name"]);
 $ext = end($test);
 $name = md5(rand(100000, 999999)) . '.' . $ext;
 $location = 'photo_url/' . $name;  
 Array($_FILES["solution-file"]["tmp_name"], $location);

 
// Start the session
session_start();
$_SESSION['solution-file'] = $location;
session_write_close();

//  echo '<a href="'.$location.'" target="_blank">View File </a>';
 
 echo '<img src="'.$location.'"class="img-thumbnail" />';
 }
 

?>






