Mini Shell
<?php include 'connection.php'; ?>
<?php
$gender=$_REQUEST['gender'];
//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','othr') ");
}
$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','othr') ");
}
}
}
}
echo json_encode($ret);
}
?>
Zerion Mini Shell 1.0