I certify that, to the best of my knowledge the statements in this application are true.
data_submit.php
0)
{
echo "Return Code: " . $_FILES["livevideo"]["error"] . "
";
}
else
{
// echo "Upload: " . $_FILES["livevideo"]["name"] . "
";
//echo "Type: " . $_FILES["livevideo"]["type"] . "
";
//echo "Size: " . ($_FILES["livevideo"]["size"] / 1024) . " Kb
";
//echo "Temp file: " . $_FILES["livevideo"]["tmp_name"] . "
";
$temp_media = explode(".", $_FILES["livevideo"]["name"]);
$new_tempfilename = date("Ymd").round(microtime(true)) . '.' . end($temp_media);
if (file_exists("dvd_data/dvd_data/" . $new_tempfilename))
{
// echo $_FILES["livevideo"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["livevideo"]["tmp_name"],
"dvd_data/dvd_data/" . $new_tempfilename);
// echo "Stored in: " . "dvd_data/" . $_FILES["livevideo"]["name"];
}
}
}
else
{
echo "Invalid file/MP4 under 50 MB";
}
$my_extension = pathinfo($_FILES['livecvfile']['name'], PATHINFO_EXTENSION);
if ((($_FILES["livecvfile"]["type"] == "image/jpeg") || ($_FILES["livecvfile"]["type"] == '"application/pdf"'))&& ($_FILES["livecvfile"]["size"] < 6000000) && in_array($my_extension, $check_extentions))
{
if ($_FILES["livecvfile"]["error"] > 0)
{
echo "Return Code: " . $_FILES["livecvfile"]["error"] . "
";
}
else
{
$temp_cv = explode(".", $_FILES["livecvfile"]["name"]);
$new_cvfilename = date("Ymd").round(microtime(true)) . '.' . end($temp_cv);
if (file_exists("dvd_data/Documents/" . $new_cvfilename))
{
//echo $_FILES["livecvfile"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["livecvfile"]["tmp_name"],"dvd_data/Documents/" . $new_cvfilename);
//echo "Stored in: " . "dvd_data/Documents/" . $_FILES["livecvfile"]["name"];
}
}
}
else
{
echo "Invalid file/JPG or PDF under 6MB";
}
$my_extension = pathinfo($_FILES['basicsign']['name'], PATHINFO_EXTENSION);
if ((($_FILES["basicsign"]["type"] == "image/jpeg") || ($_FILES["basicsign"]["type"] == '"application/pdf"'))&& ($_FILES["basicsign"]["size"] < 6000000) && in_array($my_extension, $check_extentions))
{
if ($_FILES["basicsign"]["error"] > 0)
{
//echo "Return Code: " . $_FILES["basicsign"]["error"] . "
";
}
else
{
$temp_sign = explode(".", $_FILES["basicsign"]["name"]);
$new_signfilename = date("Ymd").round(microtime(true)) . '.' . end($temp_sign);
if (file_exists("dvd_data/sign/" . $new_signfilename))
{
//echo $_FILES["basicsign"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["basicsign"]["tmp_name"],"dvd_data/sign/" . $new_signfilename);
//echo "Stored in: " . "dvd_data/Documents/" . $_FILES["basicsign"]["name"];
}
}
}
else
{
echo "Invalid file/JPG or PDF under 6MB";
}
$to = "[email protected]";
//$to = "[email protected]";
//$to2 = "[email protected]";
//$to2 = "[email protected]";
$subject = "live24u/w3free Inquiry form";
$message=" ";
$message .= "
live24u/w3free Inquiry form
live24u/w3free Inquiry form
Application Form
Shaheed Park
1. Live clients contact information |
Name |
".$empname." |
Address |
".$resaddress." |
Phone Number |
".$phonumber." |
Email |
".$email." |
Website:(if applicable) |
".$myweb." |
img_gallery/Agent:(if any) |
".$gallery." |
|
Please provide the following Data |
CV Links |
".$path.'Documents/'.$new_cvfilename." |
Media Links |
".$path.'dvd_data/'.$new_tempfilename." |
|
Please describe your creative practice with artistic development: |
".$longdesc." |
|
I certify that, to the best of my knowledge the statements in this application are true.
|
Full name |
".$firstname." |
Signature |
".$path.'sign/'.$new_signfilename." |
Date |
".$crdate." |
Best Regards
live24u/w3free Inquiry form.
";
$mail = new PHPMailer;
$mail->IsSMTP(); // Set mailer to use SMTP
//$mail->SMTPSecure = 'tls';
$mail->Host = 'ssl://smtp.Pakainfo.com'; // Specify main and backup server
$mail->Port = 465;
$mail->SMTPDebug = 1; // Set the SMTP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '
[email protected]'; // SMTP username
$mail->Password = 'liveData1245@963!$'; // SMTP password
//$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
$mail->From = '
[email protected]';
$mail->FromName = 'live24u/w3free Inquiry form';// frome name
$mail->AddAddress($to,'live24u/w3free Inquiry form');
//$mail->AddAddress($to2,'live24u/w3free Inquiry form');
$path_cv_file = $path."dvd_data/Documents/".$data_link;
$path_media_file = $path."dvd_data/dvd_data/".$video_link;
$path_sign_file = $path."dvd_data/sign/".$sign_link;
$mail->addAttachment($path_cv_file, $data_link);
$mail->addAttachment($path_media_file, $video_link);
$mail->addAttachment($path_sign_file, $sign_link);
$mail->IsHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $message;
if(!$mail->Send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
$servername = "Pakainfo.com";
$username = "root";
$password = "";
$dbname = "my_contact";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO `contact_form` (`id`, `name`, `resaddress`, `ph_no`, `email`, `myweb`, `gallery`, `cv_link`, `media_link`, `long_desc`, `full_name`, `sign`, `date`, `status`) VALUES (NULL, '$empname', '$resaddress', '$phonumber', '$email', '$myweb', '$gallery', '$new_cvfilename', '$new_tempfilename', '$longdesc', '$firstname', '$new_signfilename', now(), '1')";
if (mysqli_query($conn, $sql)) {
header("Location: index.php?message=success");
} else {
echo "Error: " . $sql . "
" . mysqli_error($conn);
}
mysqli_close($conn);
?>
Example
I hope you have Got What is how to store video file in mysql database using php And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.