Mini Shell

Direktori : /home/athamevents/public_html/admin/
Upload File :
Current File : /home/athamevents/public_html/admin/gallery_upload1.php

<?php include 'connection.php'; ?>
<?php



    
//If directory doesnot exists create it.
$output_dir = "gallery_pic/";

if(isset($_FILES["myfile"]))
{
	$ret = array();

	$error =$_FILES["myfile"]["error"];
   {
    
    	if(!is_array($_FILES["myfile"]['name'])) //single file
    	{
            $RandomNum   = time();
            
           
            $image=$_FILES["myfile"]["name"];
if($image)
{
    $temp=$_FILES["myfile"]["tmp_name"];
move_uploaded_file("$temp","gallery_pic/$image");

$reg=mysql_query("insert into gallery values('','$image','wedd') ");
}
            
            
       	 	 
	       	 	 $ret[$fileName]= $output_dir.$NewImageName;
    	}
    	else
    	{
            
            $fileCount = count($_FILES["myfile"]['name']);
    		for($i=0; $i < $fileCount; $i++)
    		{
                $RandomNum   = time();
            
                $image=$_FILES["myfile"]["name"];
if($image)
{
    $temp=$_FILES["myfile"]["tmp_name"];
move_uploaded_file("$temp","gallery_pic/$image");

$reg=mysql_query("insert into gallery values('','$image','wedd') ");
}
    		}
            
            
    	}
    }
    echo json_encode($ret);
 
}

?>

Zerion Mini Shell 1.0