📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
deptadminpanel
Dosya Düzenle: add_d_activity_code.php
<?php session_start(); include 'connect.php'; if (isset($_SESSION['Dept_HeadE'])){ $publisher=$_SESSION['Dept_HeadE']; $dept = $_POST['deptName']; $did = $_POST['did']; $year = $_POST['year']; $details= $_POST['details']; $remark= $_POST['remark']; $targetDir = 'D_upload/d_activity_U/photo/'; // Specify the target directory where the files will be uploaded $fileName = $_FILES['linkp']['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['linkp']['tmp_name'], $targetFilePath) ) { echo "Photo uploaded yes"; } else { echo "noo"; } $targetDir = 'D_upload/d_activity_U/document/'; $fileName = $_FILES['link']['name']; // Generate a unique file name $counter = 1; while (file_exists($targetDir . $fileName)) { $fileName = pathinfo($fileName, PATHINFO_FILENAME) . '_' . $counter . '.' . pathinfo($fileName, PATHINFO_EXTENSION); $counter++; } $targetFilePathd = $targetDir . $fileName; if(move_uploaded_file($_FILES['link']['tmp_name'], $targetFilePathd) ) { echo "Document uploaded yes"; } else { echo "noo"; } $sql1 = "INSERT INTO d_activity VALUES('$_POST[null]','$did','$dept','$details','$year','$remark','$targetFilePathd','$targetFilePath','$publisher')"; if(mysqli_query($con,$sql1)){ header('location:add_d_activity.php'); } else{ echo "something error"; } } ?>
💾 Kaydet
İptal