📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
adminpanel
Dosya Düzenle: url_d_code.php
<?php session_start(); include 'connect.php'; if (isset($_SESSION['Dept_head'])){ $publisher=$_SESSION['Dept_head']; $dept = $_POST['deptName']; $did = $_POST['did']; $title = $_POST['title']; $date = $_POST['date']; echo $targetDir = 'D_upload/file_U/'; // Specify the target directory where the files will be uploaded $fileName = $_FILES['link']['name']; // Get the original file name // Generate a unique file name $counter = 1; while (file_exists($targetDir . $fileName)) { $fileName = pathinfo($fileName, PATHINFO_FILENAME) . '_' . $counter . '.' . pathinfo($fileName, PATHINFO_EXTENSION); $counter++; } $targetFilePath = $targetDir . $fileName; if(move_uploaded_file($_FILES['link']['tmp_name'], $targetFilePath) ) { echo "Photo uploaded yes"; } else { echo "noo"; } $targetFilePath = 'adminpanel/'.$targetDir . $fileName; echo $sql1 = "INSERT INTO urlmake VALUES('$_POST[null]','$title','$targetFilePath','$date','$dept','$did','$publisher')"; if(mysqli_query($con,$sql1)){ header('location:urlcreate.php'); } else{ echo "something error"; } } ?>
💾 Kaydet
İptal