📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
deptadminpanel
Dosya Düzenle: event_d_code.php
<?php session_start(); include 'connect.php'; ?> <?php if (isset($_SESSION['Dept_HeadE'])){ if(isset($_POST['submit'])){ $title = $_POST['title']; $description = $_POST['description']; $organizer = $_POST['organizer']; $dept = $_POST['select']; $DOJ = $_POST['doe']; $participent = $_POST['participent']; $info = $_POST['info']; $venue = $_POST['venue']; $etype = $_POST['etype']; $publisher = $_POST['publisher']; $targetDir = 'D_upload/event_U/photo/'; // Specify the target directory where the files will be uploaded $fileName = $_FILES['Tadd_P']['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; $tagretFile1 = "deptadminpanel/".$targetDir .$fileName; if(move_uploaded_file($_FILES['Tadd_P']['tmp_name'], $targetFilePath) ) { echo "Photo uploaded yes"; } else { echo "noo"; } $targetDir = 'D_upload/event_U/document/'; $fileName = $_FILES['Tadd_F']['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; $tagretFile2 ="deptadminpanel/".$targetDir .$fileName; if(move_uploaded_file($_FILES['Tadd_F']['tmp_name'], $targetFilePathd) ) { echo "Document uploaded yes"; } else { echo "noo"; } } $ins = "insert into Event_recent values(NULL,'$title','$description','$organizer','$DOJ','$dept','$participent','$info','$tagretFile1','$tagretFile2','$venue','$etype','$publisher')"; if (mysqli_query($con,$ins)){ $sql = "select * from Event_recent where title='$title'"; $q = mysqli_query($con, $sql); if($frow = mysqli_fetch_array($q)){ $e_id = $frow['e_id']; //echo "id is ".$e_id; header("Location:e_addphoto.php?id=$e_id"); } else{ echo "not selected data"; } } else{ echo "not instered"; } } ?>
💾 Kaydet
İptal