Indramayu IT Comunity
Path:
/
home
/
guruvidyaacademy
/
public_html
/
[
Home
]
File: facultyapply.php
<?php include 'conn.php'; if(isset($_FILES['images'])){ $errors= array(); foreach($_FILES['images']['tmp_name'] as $key => $tmp_name ){ $file_name = $_FILES['images']['name'][$key]; $file_size =$_FILES['images']['size'][$key]; $file_tmp =$_FILES['images']['tmp_name'][$key]; $file_type=$_FILES['images']['type'][$key]; $desired_dir="user_data"; if(empty($errors)==true){ if(is_dir($desired_dir)==false){ mkdir("$desired_dir", 0700); } if (file_exists("resume/" . $file_name)){ $new_dir=time().str_replace(" ", "", basename($file_name)); move_uploaded_file($file_tmp,"resume/".$new_dir); $query="INSERT INTO `jobapplication`(`position`,`p_id`, `fullname`, `email`, `phone`, `experience`, `resume`,`qual`) VALUES ('".$_POST['position']."','".$_POST['p_id']."','".$_POST['fullname']."','".$_POST['email']."','".$_POST['phone']."','".$_POST['experience']."', '".$new_dir."','".implode(",",$_POST['qual'])."')"; } else{ move_uploaded_file($file_tmp,"resume/".$file_name); $query="INSERT INTO `jobapplication`(`position`,`p_id`, `fullname`, `email`, `phone`, `experience`, `resume`,`qual`) VALUES ('".$_POST['position']."','".$_POST['p_id']."','".$_POST['fullname']."','".$_POST['email']."','".$_POST['phone']."','".$_POST['experience']."', '".$file_name."','".implode(",",$_POST['qual'])."')"; } $arrays[]=$file_name; } else{ print_r($errors); } } $file_name = implode(",", $arrays); } $sq=mysqli_query($con,$query); if($sq){ echo "<script>alert('Your have successfully applied for this job');</script>"; echo "<script>window.history.go(-1);</script>"; } else{ echo 0; } ?>