Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
<?php
if(isset($_POST['email'])) {
// CHANGE THE TWO LINES BELOW
$email_to = "***.com";
$email_subject = "Enquiry from Brandsterlab";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['webdesign']) ||
!isset($_POST['ecommerce']) ||
!isset($_POST['customweb']) ||
!isset($_POST['mobile']) ||
!isset($_POST['branding']) ||
!isset($_POST['saab']) ||
!isset($_POST['mercedes1']) ||
!isset($_POST['mercedes2']) ||
!isset($_POST['mercedes3']) ||
!isset($_POST['mercedes4']) ||
!isset($_POST['message'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$name = $_POST['name']; // d
$email_from = $_POST['email']; // d
$webdesign = $_POST['webdesign']; // d
$ecommerce = $_POST['ecommerce'];
$customweb = $_POST['customweb'];
$mobile = $_POST['mobile'];
$branding = $_POST['branding'];
$saab = $_POST['saab'];
$mercedes1 = $_POST['mercede s1'];
$mercedes2 = $_POST['mercedes2'];
$mercedes3 = $_POST['mercedes3'];
$mercedes4 = $_POST['mercedes4']; // not d
$message = $_POST['message']; // d
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+***[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$webdesign)) {
$error_message .= 'The webdesign you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$customweb)) {
$error_message .= 'The customweb you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$branding)) {
$error_message .= 'The branding you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$saab)) {
$error_message .= 'The saab you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$mercedes1)) {
$error_message .= 'The mercedes1 you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$mercedes2)) {
$error_message .= 'The mercedes2 you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$mercedes3)) {
$error_message .= 'The mercedes3 you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$mercedes4)) {
$error_message .= 'The mercedes4 you entered does not appear to be valid.<br />';
}
if(strlen($message) < 2) {
$error_message .= 'The message you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Project Category & Budget: ".clean_string($webdesign)."\n";
$email_message .= "Project Category & Budget: ".clean_string($ecommerce)."\n";
$email_message .= "Project Category & Budget: ".clean_string($customweb)."\n";
$email_message .= "Project Category & Budget: ".clean_string($mobile)."\n";
$email_message .= "Project Category & Budget: ".clean_string($branding)."\n";
$email_message .= "Budget: ".clean_string($saab)."\n";
$email_message .= "Budget: ".clean_string($mercedes1)."\n";
$email_message .= "Budget: ".clean_string($mercedes2)."\n";
$email_message .= "Budget: ".clean_string($mercedes3)."\n";
$email_message .= "Budget: ".clean_string($mercedes4)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
***($email_to, $email_subject, $email_message, $headers);
//<!-- place your own success html below -->
echo "Thank you for contacting us. We will be in touch with you very soon.<br /><br />";
}
die();
Offline
Hi,
sorry how this is related to live helper chat?
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline
where should i post this php relatd doubt?
Offline
This is the live helper chat forum.
If you have question about PHP code of website you can try to ask on
https://stackoverflow.com/
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline