Contact form help

This was part of the original website that I had built years ago.

This is the code from contact.php

<?php

if(!$_POST) exit;

$email = $_POST['email'];


//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
$error.="Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ('name','phone','company','email','message');
$required = array('name','email','message');

$your_email = "support(at)pritechs.com";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message:\n";

foreach($values as $key => $value){
if(in_array($value,$required)){
if ($key != 'subject' && $key != 'company') {
if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
}
$email_content .= $value.': '.$_POST[$value]."\n";
}
}

if(@mail($your_email,$email_subject,$email_content)) {
echo 'Message sent!';
} else {
echo 'ERROR!';
}
}
?>
Just a thought, your email is support(at)pritechs.com in this form. It should be the actual email address in this form.


they spent considerable time testing with live users dozens of different concepts, ideas, presentations, web sites, etc. Bottom line - People don't like contact pages! They are clunky, impersonal and the bail/leave page rate is close to 30% in their tests.
Its completely possible, but I'd love to see their data on how they came to that conclusion. The thing with statistics is you need to know how to translate them and often it takes experience to be able to do it.

For example, I 100% beleive that their bail/leave page rate is close to 30% on their about page in their test. BUT, its possible people are looking for a phone number or an address on the contact page. Once they got it they leave because they got what they came for. This would result in a higher bounce rate yet mean the opposite, that people DO like contact pages because it did what they wanted it to do.

Back onto the topic: I'd probably do a visual email address support@whatever.com which links to the contact page, a visual phone number and a contact page.
Mailto is horribly unreliable, It only works own machine because I have Chrome installed and associated my mailto links with Gmail. If I went to my mums computer for example, it would open the built in email client that isnt even set up.
 
Its completely possible, but I'd love to see their data on how they came to that conclusion. The thing with statistics is you need to know how to translate them and often it takes experience to be able to do it.

For example, I 100% beleive that their bail/leave page rate is close to 30% on their about page in their test. BUT, its possible people are looking for a phone number or an address on the contact page. Once they got it they leave because they got what they came for. This would result in a higher bounce rate yet mean the opposite, that people DO like contact pages because it did what they wanted it to do.

Back onto the topic: I'd probably do a visual email address support@whatever.com which links to the contact page, a visual phone number and a contact page.
Mailto is horribly unreliable, It only works own machine because I have Chrome installed and associated my mailto links with Gmail. If I went to my mums computer for example, it would open the built in email client that isnt even set up.

Not her study but as it was given to me - The actual bail rate was 78% on the contact page. After interviews with users and accounting for as many variables as possible they came up with a dislike/won't use "contact pages" statistic of 29%. Sorry - I don't know all the details.

And I agree - the Mailto call isn't the best sometimes but the vast majority of the users do have the correct email program defaulted (it is a major setting for most) and there may be a few that have to manually address an email. Besides, phone/text works for those that are email shy.
 
... rather than waste your time creating your own contact form from scratch, why not just use one out of the plethora of free form building tools?
This.

I prefer self-hosted, so I have used Mike Challis's Fast Secure Contact Form for years, with great success. PHP or Wordpress plugin.

I'm still running a html site.

It's trivial to use the PHP version in an otherwise purely HTML site, certainly for someone who's prepared to craft their own form.
 
Back
Top