HEX
Server: LiteSpeed
System: Linux server137.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: bibuzptr (1123)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/bibuzptr/elearning.bibu-edu.us/backup/admin/app/updateimage.php
<?php
if(isset($_POST['update_image'])){
  //upload image to db

$target_dir = "../course-images/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$file = basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);

$pproductid=$_POST['pproductid']; 

if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
} else {
$er= "<div class='alert alert-danger fade in'><a href='' class='close' data-dismiss='alert' aria-label='close'>&times;</a>there was an error uploading your file.</div>";
}

$upl=mysqli_query($con,"UPDATE courses SET courseimage='$file' WHERE id='$pproductid'");
if($upl){
  echo '<script>alert("image uploaded successfully")</script>';
}else{
  echo '<script>alert("error uploading image")</script>';
}

}

if(isset($_POST['update_imageschool'])){
  //upload image to db

$target_dir = "../school-images/";
$target_file = $target_dir . basename($_FILES["fileToUploadschool"]["name"]);
$file = basename($_FILES["fileToUploadschool"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);

$pproductid=$_POST['pproductidschool']; 

if (move_uploaded_file($_FILES["fileToUploadschool"]["tmp_name"], $target_file)) {
} else {
$er= "<div class='alert alert-danger fade in'><a href='' class='close' data-dismiss='alert' aria-label='close'>&times;</a>there was an error uploading your file.</div>";
}
$file1 = basename($_FILES["fileToUploadschool1"]["name"]);
$target_file1 = $target_dir . basename($_FILES["fileToUploadschool1"]["name"]);
move_uploaded_file($_FILES["fileToUploadschool1"]["tmp_name"], $target_file1);

$upl=mysqli_query($con,"UPDATE schools SET icon='$file',deanimage='$file1' WHERE id='$pproductid'");
if($upl){
  echo '<script>alert("image uploaded successfully")</script>';
}else{
  echo '<script>alert("error uploading image")</script>';
}

}

if(isset($_POST['update_studentimage'])){
  //upload image to db

$target_dir = "../student-images/";
$target_file = $target_dir . basename($_FILES["fileToUploadsch"]["name"]);
$file = basename($_FILES["fileToUploadsch"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);

$pproductid=$_POST['studentid']; 

if (move_uploaded_file($_FILES["fileToUploadsch"]["tmp_name"], $target_file)) {
} else {
$er= "<div class='alert alert-danger fade in'><a href='' class='close' data-dismiss='alert' aria-label='close'>&times;</a>there was an error uploading your file.</div>";
}

$upl9=mysqli_query($con,"UPDATE students SET icon='$file' WHERE id='$pproductid'");
if($upl9){
  echo '<script>alert("image uploaded successfully")</script>';
}else{
  echo '<script>alert("error uploading image")</script>';
}

}
?>