Contact form help

I personally stay away from contact pages. For the most part they piss people off. I put my email ( mailto: ) and phone number up on every web page. I ask people to do what is most comfortable for them - call, text, or email me.
 
  • Like
Reactions: GTP
Yep - It works for you. Have you ever met anyone who liked filling out a contact form rather than using their favorite email window? I didn't think so......
 
Yep - It works for you.
Indeed. What works for me probably wont work for you nor anyone else, however, giving a potential client every option available is what I prefer to offer. I would also agree that it does not work or appeal to everyone and obviously not everyone likes using a contact form. The situation is not unique however.

I didn't think so......
It works for you.
 
We aren't the Apples, IBMs, and Allstate Insurances of the world. Why would you use a contact page if all inquiries can be directed personally to you? Because that's what they did 10 years ago? Com'on. Things be a changing. Don't get set in yesterday.
 
I don't mind filling out a contact form... It Works for me as well... My contact form says Ask a question We ask for name, email and your inquiry, its on every page of our website...
If they are on your website already they are looking for something its handier than opening up an email and referring back to the website.
Ours is used quite often and never had a complaint. they know they will always get me.
 
If they are on your website already they are looking for something its handier than opening up an email and referring back to the website.

That's why I specifically mentioned the HTML "mailto" call on the web page. It greets them with their favorite email program, addresses it and lets them type an email like it was to their best friend.

Guys - I'm not here to argue. Contact pages are so "BIG CORPORATION" and out of date that you really need to review how you use them. I know they work for you, but most of the population hates them.
 
Last edited:
That's why I specifically mentioned the HTML "mailto" call on the web page. It greats them with their favorite email program, addresses it and lets them type an email like it was to their best friend.

Guys - I'm not here to argue. Contact pages are so "BIG CORPORATION" and out of date that you really need to review how you use them. I know they work for you, but most of the population hates them.

Contact forms fight spam and force people to give enough information so I don't look like an idiot when I reply.
 
How did you get this? Something you picked up and then modified? I notice in the HTML for the page there is a reference for contact.php. Did you look at that file?

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!';
}
}
?>
 
Subject is missing in contact.php but I'd think that should not matter. Do you have the old website to fire up and test?

I have the original files. Can play around with the original.

The other option is learning how to create my own. Long term plan is to get a Wordpress site done once I have money coming in.
 
Your problem is you are checking to see if the field is required but if it's not required you aren't adding it. Look here:
foreach($values as $key => $value){
***if(in_array($value,$required)){***
...
$email_content .= $value.': '.$_POST[$value]."\n";
***}***
}

You need to change it to something like this:

Code:
$numRequiredSubmitted =0;
foreach($values as $key => $value){
     if(in_array($value,$required) && !empty($_POST[$value])){
           $numRequiredSubmitted+=1;
     }
        $email_content .= $value.': '.$_POST[$value]."\n";
    }

if ($numRequiredSubmitted != count($required)){
      echo 'PLEASE FILL IN REQUIRED FIELDS'; 
      exit;
}

Sorry if there are any typos. I'm on my cell phone and coding sucks with autocorrect lol
 
Last edited:
I personally stay away from contact pages. For the most part they piss people off. I put my email ( mailto: ) and phone number up on every web page. I ask people to do what is most comfortable for them - call, text, or email me.

In my opinion you should never use a mailto link but I don't even have my phone number in plain text on my site, its just an image of the text. The more popular your site gets the more your email and phone number get extracted and the more spam and telemarketers you get.
 
In my opinion you should never use a mailto link but I don't even have my phone number in plain text on my site, its just an image of the text. The more popular your site gets the more your email and phone number get extracted and the more spam and telemarketers you get.

Again - Don't get stuck in the past. I used to do this 10-15 years ago on my web sites. For the last 2-3 years I put my email (and phone) in plain text in a "mailto" call on every web page. I've said it before and I'll say again - I run my domained email and phone through Gmail/GV and I get absolutely NO SPAM!
 
Back
Top