hjkhhndndndnd,trt
bnmbertsu,yu,yu,fffffffy,ltdfg
/
home4
/
gofvotmy
/
public_html
/
hinducollegeamritsarac.in
/
hcaadmin
/
Upload FileeE
HOME
<?php include "connection.php"; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $date = date('Y-m-d H:i:s'); $targetDirectory = "uploadNewsGallery/"; // Create the directory if it doesn't exist if (!is_dir($targetDirectory)) { mkdir($targetDirectory, 0755, true); } // Process each uploaded file foreach ($_FILES['UploadSmallFiles']['name'] as $key => $name) { $uploadFilePath = $targetDirectory . basename($name); move_uploaded_file($_FILES['UploadSmallFiles']['tmp_name'][$key], $uploadFilePath); // Insert image details into the database $query = "INSERT INTO hcanews (hcanews, newsdate) VALUES ('$uploadFilePath', '$date')"; $result = mysqli_query($con, $query); if (!$result) { echo '<script language="javascript">'; echo 'alert("Error Try Again")'; echo '</script>'; exit; } } echo '<script language="javascript">'; echo 'alert("Content Updated Successfully")'; echo '</script>'; } ?>