( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
error_reporting(0);
include('../Connections/videoondemand.php');
$path = "uploads/raw/";
$actual_image_name="";
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg","PNG","JPG","JPEG","GIF","BMP");
if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
{
$mixed =$_POST['u'];
$process = explode("-", $mixed);
$checkcount = count($process);
$c = $checkcount - 1; // find last element
$n = $checkcount - 2;
$a = $checkcount - 3;
$yanani = $process[$c];
$videouser = $process[$n];
$appno = $process[$a];
include_once 'scripts/getExtension.php';
$imagename = $_FILES['photoimg']['name'];
$size = $_FILES['photoimg']['size'];
if(strlen($imagename))
{
$ext = strtolower(getExtension($imagename));
if(in_array($ext,$valid_formats))
{
if($size<(2024*2024))
{
$actual_image_name = time().substr(str_replace(" ", "_", $txt), 5).".".$ext;
$uploadedfile = $_FILES['photoimg']['tmp_name'];
/*include 'scripts/compressImage.php';*/
include 'scripts/compressImage2.php';
$widthArray = array(200,100,50);
foreach($widthArray as $newwidth)
{
$filename=compressImage($ext,$uploadedfile,$path,$actual_image_name,$newwidth);
/* echo "<img src='v/".$filename."' class='img'> <br/>";
echo "<b>Width:</b> ".$newwidth."px <br/><b>File Name:</br> ".$filename."<br/><br/>";*/
}
if(move_uploaded_file($uploadedfile, $path.$actual_image_name))
{
$time=time();
$ip=$_SERVER['REMOTE_ADDR'];
$newsid=rand(1111111111111,9999999999999999);
/*
$query = mysqli_query("INSERT INTO `reporta` (appno,message,catalogid_fk,catalogid, ip,created,type,original,isdisplay,keywords,slug,newsid) VALUES ('$appno','$part', '$yanani', '$yanani','$ip','$time',$type,'$upload','$isdisplay','$keyworda','$url','$time')") or die(mysql_error());*/
//mysqli_query($db,"INSERT INTO user_uploads(image_name,user_id_fk,created) VALUES('$image_name','$session_id','$time')");
echo "<img src='v/".$path.$actual_image_name."' class='preview'> ";
}
else
echo "Fail upload folder with read access.";
}
else
echo "Image file size max 1 MB";
}
else
echo "Invalid file format..";
}
else
echo "Please select image..!";
exit;
}
?>