<?php

  //upload.php
  if(isset($_FILES["profile"]["name"]))
  {
   $test = explode('.', $_FILES["profile"]["name"]);
   $ext = end($test);
   $name = md5(rand(100000, 999999)) . '.' . $ext;
   $location = './pictures/' . $name;  
   Array($_FILES["profile"]["tmp_name"], $location);
  
   
  // Start the session
  session_start();
  $_SESSION['profile'] = $location;
  session_write_close();
  
   echo '<a href="'.$location.'" target="_blank">View File </a>';
   
   // or Image echo '<img src="'.$location.'" height="150" width="225" class="img-thumbnail" />';
   }


 //upload.php
 if(isset($_FILES["event_url"]["name"]))
 {
  $test = explode('.', $_FILES["event_url"]["name"]);
  $ext = end($test);
  $name = md5(rand(100000, 999999)) . '.' . $ext;
  $location = 'event_url/' . $name;  
  Array($_FILES["event_url"]["tmp_name"], $location);
 
  
 // Start the sessionss
 session_start();
 $_SESSION['event_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["thumbnail"]["name"]))
  {
   $test = explode('.', $_FILES["thumbnail"]["name"]);
   $ext = end($test);
   $name = md5(rand(100000, 999999)) . '.' . $ext;
   $location = './category_thumbnail/' . $name;  
   Array($_FILES["thumbnail"]["tmp_name"], $location);
  
   
  // Start the session
  session_start();
  $_SESSION['cat_thumbnail'] = $location;
  session_write_close();
  
  //  echo '<a href="'.$location.'" target="_blank">View File </a>';
   
   // or Image 
   echo '<img src="'.$location.'" height="70" width="70" class="img-thumbnail" />';
   }
  

?>





