📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
adminpanel
Dosya Düzenle: d_cadd_code.php
<?php session_start(); include 'connect.php'; if (isset($_SESSION['Dept_head'])){ $publisher=$_SESSION['Dept_head']; $dept = $_POST['deptName']; $did = $_POST['did']; $cname = $_POST['cname']; $cdetails = $_POST['cdetails']; $year = $_POST['year']; $duration = $_POST['duration']; $capacity = $_POST['capacity']; echo $targetDir = 'D_upload/pos_sop_lo/'; // 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/pos_sop_lo/'; $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 course VALUES('$_POST[null]','$did','$dept','$cname','$cdetails','$duration','$capacity','$year','$targetFilePath','$targetFilePathd','$publisher')"; if(mysqli_query($con,$sql1)){ header('location:add_course.php'); } else{ echo "something error"; } } ?>
💾 Kaydet
İptal