forked from codepandaasia/hombenai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.php
56 lines (52 loc) · 1.94 KB
/
check.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'db.php';
if (isset($_FILES["check_file"])) {
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["check_file"]["name"]);
$imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
// Check if the file is an actual image
$check = getimagesize($_FILES["check_file"]["tmp_name"]);
if ($check !== false) {
// Save the uploaded file temporarily
if (move_uploaded_file($_FILES["check_file"]["tmp_name"], $target_file)) {
echo "<script>alert('උස්සපු හරකෙක් රාලහාමි');</script>";
echo "<h2>උස්සපු හරකෙක් රාලහාමි</h2>";
} else {
echo "Sorry, there was an error uploading your file.";
}
} else {
echo "File is not an image.";
}
} else {
echo "No file was uploaded.";
}
?>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'db.php';
if (isset($_FILES["check_file"])) {
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["check_file"]["name"]);
$imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
// Check if the file is an actual image
$check = getimagesize($_FILES["check_file"]["tmp_name"]);
if ($check !== false) {
// Save the uploaded file temporarily
if (move_uploaded_file($_FILES["check_file"]["tmp_name"], $target_file)) {
echo "<script>alert('උස්සපු හරකෙක් රාලහාමි');</script>";
echo "<h2>උස්සපු හරකෙක් රාලහාමි</h2>";
} else {
echo "Sorry, there was an error uploading your file.";
}
} else {
echo "File is not an image.";
}
} else {
echo "No file was uploaded.";
}
?>