ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/home2/selectio/public_html/y1jobportal.in/api/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/home2/selectio/public_html/y1jobportal.in/api/send_mail.php

<?php

session_start();
include "../admin/api/config/config.php"; 


if(isset($_POST['type']) && $_POST['type']=='send_mail'){
    
   
         try{
             
            $date = date("Y-m-d"); 
            
            if(isset($_FILES['attachment']) && $_FILES['attachment']['name'] != ""){
            $file_name = $_FILES['attachment']['name'];
            $tmp = explode('.', $file_name);
            $extension = end($tmp);
            $imageS = rand(10, 1000000000) . "-" . $date . "-resume." . $extension;
            $upload = move_uploaded_file($_FILES['attachment']['tmp_name'], '../uploads/image/' . $imageS);
            $path = 'https://y1jobportal.in/uploads/image/' . $imageS;
            } else {
                $path = '';
            }

            $sender_name = $_POST['sender_name'];
            $phone = $_POST['phone_no'];
            error_log($phone."stephen");
            $subject = $_POST['subject'];
            $email = $_POST['email'];
            $form_type = $_POST['form_type'];
            $job_type = $_POST['job_type'];
            
            
            error_log("INSERT INTO `tbl_mail`(`name`,`mobile_no`,
            `email`,`subject`,
            `form_type`,`job_type`,`cv_file`) VALUES ($sender_name,$phone,
            $email,$subject,
            $form_type,$job_type,$path)");
            $statement = $pdo->prepare("INSERT INTO `tbl_mail`(`name`,`mobile_no`,
            `email`,`subject`,
            `form_type`,`job_type`,`cv_file`) VALUES (?,?,
            ?,?,
            ?,?,?)");   
            $result=$statement->execute(array($sender_name,$phone,
            $email,$subject,
            $form_type,$job_type,$path));
        
             
                   if($result){ 
                        $return_arr['message']='Email Sended Successfully';
                        $return_arr['status']=200;
                    } 
                else{
                    $return_arr['message']='Something Went Wrong..';
                    $return_arr['status']=400;
                }
            
                }catch(Exception $e){
                    $return_arr['message']="You have already submited";
                    $return_arr['status']=500;
                }   
                echo json_encode($return_arr);
    }
    

?>

Zerion Mini Shell 1.0