PATH: /home/hwyuvbry/public_html/kerbau/function
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 add-bank.php
↓
X
📄 add-banner.php
↓
X
📄 add-game.php
↓
X
📄 add-member.php
↓
X
📄 add-post.php
↓
X
📄 add-promo.php
↓
X
📄 add-promosid.php
↓
X
📄 add-slide.php
↓
X
📄 add-user.php
↓
X
📄 api_call_scatter.php
↓
X
📄 api_nexusggr.php
↓
X
📄 api_set_rtp.php
↓
X
📄 bank-status.php
↓
X
📄 banner-status.php
↓
X
📄 banner.php
↓
X
📄 del-backup.php
↓
X
📄 del-bank.php
↓
X
📄 del-banner.php
↓
X
📄 del-post.php
↓
X
📄 del-promosid.php
↓
X
📄 del-slide.php
↓
X
📄 del-user.php
↓
X
📄 delete_qris.php
↓
X
📄 edit-member.php
↓
X
📄 edit-user.php
↓
X
📄 end-session.php
↓
X
📄 error_log
↓
X
📄 getwinner.php
↓
X
📄 getwinner_2.php
↓
X
📄 index.php
↓
X
📄 integapi.php
↓
X
📄 minimal.php
↓
X
📄 nexus.php
↓
X
📄 post-chat.php
↓
X
📄 post-status.php
↓
X
📄 proses-group.php
↓
X
📄 proses_topup-manual.php
↓
X
📄 proses_topup.php
↓
X
📄 proses_withdraw.php
↓
X
📄 qris.php
↓
X
📄 reject_topup.php
↓
X
📄 reject_withdraw.php
↓
X
📄 setting.php
↓
X
📄 slide-status.php
↓
X
📄 social.php
↓
X
📄 topup.php
↓
X
📄 update_qris.php
↓
X
📄 user-game.php
↓
X
📄 user-status.php
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: qris.php
<?php include('../session.php'); $nama_qris = mysqli_real_escape_string($conn, $_POST['nama_qris'] ?? ''); $status = intval($_POST['status'] ?? 1); // default aktif $uploadDir = '../../upload/qris/'; // Pastikan folder upload ada if (!file_exists($uploadDir)) { mkdir($uploadDir, 0777, true); } if (isset($_FILES['image']) && $_FILES['image']['error'] == 0) { $allowed = ['jpg', 'jpeg', 'png']; $filename = $_FILES['image']['name']; $filesize = $_FILES['image']['size']; $filetmp = $_FILES['image']['tmp_name']; $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); // Validasi ekstensi file if (!in_array($ext, $allowed)) { header('location:../qris.php?notif=3'); // ❌ ekstensi tidak valid exit; } // Validasi ukuran file (maks 2 MB) if ($filesize > 5 * 1024 * 1024) { header('location:../qris.php?notif=2'); // ❌ ukuran terlalu besar exit; } // Nonaktifkan QRIS lama jika yang baru diaktifkan if ($status == 1) { mysqli_query($conn, "UPDATE tb_qris SET status = 0"); } // Simpan file baru dengan nama unik $newname = 'qris_' . time() . '.' . $ext; $target = $uploadDir . $newname; if (move_uploaded_file($filetmp, $target)) { // Simpan ke database $sql = "INSERT INTO tb_qris (nama_qris, gambar_qris, keterangan, status) VALUES ('$nama_qris', '$newname', 'Aktif', '$status')"; if (mysqli_query($conn, $sql)) { header('location:../qris.php?notif=1'); // ✅ berhasil exit; } else { echo "Database error: " . mysqli_error($conn); } } else { echo "Upload gagal!"; } } else { header('location:../qris.php?notif=4'); // ❌ tidak ada file diupload exit; } ?>
SIMPAN PERUBAHAN