%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.216.226 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/cehaburo/public_html/admin/dba/ |
Upload File : |
<?php
ob_start();
include "../lib/include.php";
// Check if image file is a actual image or fake image
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$sequence = $_POST['sequence'];
$keys = "`sequence`, `image_url`";
$values = "'".$sequence."', ''";
foreach($languages as $language){
$title = addslashes($_POST['title_'.$language['key']]);
$subtitle = addslashes($_POST['subtitle_'.$language['key']]);
$content = addslashes($_POST['content_'.$language['key']]);
$btn_text = addslashes($_POST['btn_text_'.$language['key']]);
$btn_url = addslashes($_POST['btn_url_'.$language['key']]);
$keys = $keys.", title_".$language['key'].", subtitle_".$language['key'].", content_".$language['key'].", btn_text_".$language['key'].", btn_url_".$language['key'];
$values = $values.", '".$title."', '".$subtitle."', '".$content."', '".$btn_text."', '".$btn_url."'";
}
echo $insert_query = "INSERT INTO `tbl_featured_gallery`(".$keys.") VALUES (".$values.")";
$insert_result = $ceha->query($insert_query);
$insert_id = $ceha->insert_id;
$target_dir = "../../images/showreal/";
$target_file = $target_dir.basename($_FILES["image_url"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
$check = getimagesize($_FILES["image_url"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
// Check if file already exists
/*if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}*/
// Check file size
if ($_FILES["image_url"]["size"] > 10000000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif") {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
echo $new_name = uniqid();
$target_file2 = $target_dir.$new_name.".".$imageFileType;
if (move_uploaded_file($_FILES["image_url"]["tmp_name"], $target_file2)) {
echo "The file ".$target_file2. " has been uploaded.";
$update_result = $ceha->query("UPDATE `tbl_featured_gallery` SET `image_url`='images/showreal/".$new_name.".".$imageFileType."' WHERE `id`='".$insert_id."'");
} else {
echo "Sorry, there was an error uploading your file.";
}
}
header("Location: ../featured-gallery-insert.php");
}
ob_end_flush();
?>