
One thing I’ve been putting off is adding a ‘Contact Us’ form on my niche stores. Sure, I could do this fairly easily by simply adding a ‘Contact Us’ link and including my email address. But if I do this I risk having spam harvesters collecting my email address and filling my inbox with spam. I do have a program I purchased that allows me to hide my email address but it is fairly complex to set up so I’ve put this on the back burner.
Then along comes BANS forum member, mistermickster, who told me he created his own ‘Contact Us’ form specifically for Build A Niche Stores and asked if I wanted to post instructions on how to add it to niche stores. First I checked out what he had done, then I installed his method on one of my sites. After doing these two things my answer to him was an immediate yes.
Why should you bother adding a ‘Contact Us’ form to your site? There are several reasons. First, it makes your site look that much more professional, giving you an edge over competition for your niche. Second, it allows visitors to ask questions. This is a great way to get feedback or ideas to improve your site.
When site visitors use your ‘Contact Us’ form then their email is sent to the email address you entered into your site’s ‘Security’ tab in Admin. It is likely that you won’t want email from every site you have going to the same address so in the steps below I’ll explain how to create emails for every site you have and link them to one account for easy retrieval and viewing.
One of the best features of this mod is that it uses captcha images. This means visitors have to enter the characters they see in a box into a text field. This additional step helps prevent spam harvesters. It is an extra security field for you.
I really appreciate mistermickster sharing this mod with me and allowing me to share it with you.
My instructions to add a ‘Contact Us’ form on your site: | |
Step One | |
| Download the contactus.zip file, save it to your computer, and extract its contents. | |
| Step Two | |
| Upload the contact.php and captchaimg.php files from the zip file to your site’s root folder, where your site’s index.php is located (you can upload these files using an FTP program or through your site’s cPanel File Manager.) | |
Step Three | |
| Go to the FrontControl.php file (click here if you don’t know how to do this) for your site. | |
| Save a copy of the original code (click here for instructions on how to do this). | |
| Search for the following code: | |
| } return $f; } function printPagesStaggeredChildren($id, $arrChildren, $level = 0) | |
| Replace the above code with the contents of contactus01.htm. Save changes and view site for errors. | |
| Step Four | |
| Log in to your site’s Admin and click on the ‘Template‘ tab and ‘styles.css‘ link for the template you are using. | |
| Save a copy of the original code (click here for instructions on how to do this). | |
| Copy the contents of contactus02.txt and paste it to the bottom of your style.css. Save changes and view site for errors. | |
. | |
As I said above, all emails are sent to the address you entered in your site’s Admin Security tab. If you are like me you have entered the same email address for every site you have. You won’t want emails from various sites sent to one email because you’ll have no idea what site the emails are coming from or referring to.
There are several ways to deal with this. The solution I have chosen is a simple one that will allow you to add unique email address for every niche store you have and let you check them all in a single place. No, I don’t mean your inbox, such as Outlook or Outlook Express. This is even easier than that.
What I suggest requires creating multiple accounts with Google’s gmail. For those who may be worried, you are allowed to have multiple gmail accounts as long as your purpose for the accounts doesn’t violate Google’s TOS. Using your email accounts for ‘Contact Us’ purposes only is an acceptable use of multiple accounts.
I realize not everyone will want to use Google’s gmail. If you don’t want to do this then I’m afraid I’m leaving it up to you to figure out how to deal with the email address aspect of creating ‘Contact Us’ forms. I apologize but I simply don’t have the time to write instructions for every method available for doing this.
My instructions to add unique email addresses to every niche store you have: | |
Step One | |
| Go to Google’s gmail and create a primary email account with Google’s gmail. By primary I mean the account that you will log into to check all emails you may have received from all your niche stores. | |
| I suggest you name it something like, ‘MainEmailAccount@gmail.com‘ or ‘MyMainNicheStoreEmails@gmail.com‘ to remind you of the purpose of the email account. The name you want may be taken already so play around until you find an available name. | |
| Step Two | |
| Log in to your first niche site’s Admin and click on the ‘Security‘ tab. Enter the primary gmail email address you created in step one above in the ‘Email‘ section but modify it as follows: | |
MainEmailAccount+NicheStore01@gmail.com | |
| Save changes (this will automatically log you out of Admin) | |
| Step Three | |
| Repeat step two of these instructions for every niche store you add a ‘Contact Us’ form to. For every store add a unique +NicheStoreDescription so you will know what store an email is coming from. | |
. | |
Now that you have created a primary email account and unique variations of this account for each niche store you need to periodically check your primary account for messages. When you log in you will see all your emails in one centralized place. But you won’t know which niche store your emails have come from just by looking at your inbox:

To figure out which store your email came from you need to click on an email to open it. Once you have done this you need to click the ‘show details‘ link:

Now you can see what email address the message was sent to, and this tells you what store the email is coming from and referring to:

That’s it. You now have a ‘Contact Us’ link automatically added to your site’s Store Navigation sidebar, a unique email address set up for each of your niche stores, and an easy way to read any messages you are sent. Go ahead and click it to send yourself an email to verify that it works. Pretty nifty, eh?
A big thank you to Dave for simpifying the unique email aspect of these instructions.
Rochelle
2008-07-21 Edit: Antonio attempted to share how to change the entry field titles, as well as change colors, but the code he posted wouldn’t show correctly. He emailed it to me so I can post it with the code showing. Here is what he sent me:
“In order to change the entry field titles (like “Name:”, “Subject:”, etc.), just do this:
1. In the styles.css template, insert the following AT THE END of the Contact Us code:
td#contact {
font-size: 1.2em;
color: #ffffff;
}
2. To change the page title color (Contact Us), go to the contact.php file and search for the following code:
<h1>Contact Us</h1>
and replace with the following:
<h1 id=’contact’>Contact Us</h1>
2. In your styles.css file, place the following code near the bottom:
h1#contact {
color: whatever-colour-you-like-here;
}
Antonio”
Hi Mick
Thank you so much for your help. I’m sorry to be dense about this – I amended the code and it now looks like this:-
}
}
$f .= “<a href=’”.URL_PATH.”/contact.php’ rel=’nofollow’“;
return $f;
}
I’ve not got it right, because the sidebar heading is now twice the size it was. I should be grateful if you would correct the code for me.
Thanks.
Denise
Sorry, code did not display properly – I’ll try again –
}
}
$f .= “<a href=’”.URL_PATH.”/contact.php’ rel=’nofollow’
“;
return $f;
}
If the code does not display this time, perhaps you would tell me how it should look. I really appreciate your help. Thank you.
Denise
Hi Denise,
You need to put the code in FrontControl.php back to what it was before you added the mod. If that’s the only mod you’ve made, just re-upload the original from the BANS download.
The code should look similar to this
}
return $f;
}
Mick
Hi Mick
That has worked beautifully. Thank you!
Denise
Holly,
You asked if I think there will be a problem with putting the ‘Contact Us’ link in the footer. No, I cannot think of any potential problems with this.
You are brilliant for having figured this out! Thank you so much for sharing. I will add a post in a few days about how to do what you shared.
Rochelle
Hi Mick and you all,
Thank you for solving this problem for v2.0.
It’s working beautifully.
Ildiko
Hi guys,
I’m sorry, it was too early to say OK.
I tested the form, it’s working fine, but there is an error on top of the page:
http://digital-camera-auctions.com/contact.php
I left it there for the time being, probably one of you can help how to solve this.
Thanks in advance.
Ildiko
Hi Ildiko
Sorry, I didn’t think it through properly.
The contact form page is a cut down version of index.php with the relevant text added. Obviously, I’ve taken it from V3 as that is the only code I have.
It can be made to work perfectly with all versions, but I would need to create a contact.php file for each. So if you PM me on the BANS forum, I will forward you my email address and if you send me a v2 index.php file, I’ll return you a v2 contact.php file.
Cheers,
Mick
[...] I wrote about how to add a ‘contact us’ form using the excellent mod created by BANS forum member, mistermickster. But, as was commented on [...]
Hi Rochelle,
So glad I could contribute as I’ve used so many of your mods! Can’t take full credit though. I realized from Mick’s post to Denise that FrontControl.php should be returned to its original form. Since I only deleted “Contact Us” and it worked, I thought it was correct. So thanks to Mick for clearing that up!
Again, thanks to you for your great site!
Enjoy the summer!
Holly
Hi Rochelle,
Thank you for this mod it works great. and all your other mods.
I do have a couple of questions.
I put the contact mod in my site (www.granitestonemarble.com/)
My content area had a black background and I tried to change the text colors to white here:
/* Contact Us Start */
p#contact {
font-family: Verdana;
font-size: 1.2em;
}
p#error {
font-family: Verdana;
font-size: 1.2em;
color: #cc0000;
}
td#contact i b {
font-size: 1.2em;
color: #cc0000;
}
/* Contact Us End */
and it didn’t change so I changed the content background to white…Is there anyway I can change the text color?
2nd Question.
On my other site that I’m building I forgot to put the text: contactus02.txt in style.css. and as you can see it still works.
Is It unnecessary to put the text in style.css? even though It works without It?
Thanks,
Rick
Hi Rick,
It doesn’t matter if you don’t put the styles.css text in.
What it means, is that you won’t be able to amend the look of the contact form without changing the look of your other pages. The text just allows the form to be changed independantly.
Cheers,
Mick
Thanks Mick,
“It doesn’t matter if you don’t put the styles.css text in.”
Now I just have to get my first question answered
Is there anyway I can change the text color?
Rick
Hi all,
Great mod. Between you and Mark, we got the field beat!
Now some Q’s
1. How do we get this to appear in the content pages of the admin panel? This needs to be there so we can add some ads etc.
2. Asked above and here again. How do we change the text colours?
Thank you
You can’t add the contact form to the content pages in admin because it uses php code which you can’t enter in the editor. That’s why it was done separately in the first place.
Changing the text colours on the contact page?
You need to add a color tag to the following stylesheet group
p#contact {
font-family: Verdana;
font-size: 1.2em;
color: #000099;
}
[...] few months ago I wrote about How to Add a ‘Contact Us’ Form to Your Site, a mod created by BANS forum member, mistermickster. If you follow those instructions you will end [...]
Hi Rochelle,
I have just placed the contact form on my site and it works perfectly.Thanks for a great little script.Just have to remember to keep the php files safe incase of any future updates to the BANS script.
One thing I would like to add though is this.With the email issue you mention about different addresses for each store,I use the email forwarder in Hostgators’ Cpanel and add for instance:
admin@website-address.com
This is then forwarded to my personal address but comes up in Outlook Express as coming from my store so I know where each email comes from.
I hope I have explained all this correctly.
Thanks again,
Alan.
Alan,
Forwarding emails is an idea I hadn’t thought of but it’s a good one! Thank you for sharing
Rochelle
Great MOD! Congratulations for your super explanation! It works like a charm.
The only thing I would like to know is how to change the text color of the field names. They are defaulted to black, but my BANS store uses a black background. I would like to make the text white, but playing around with the styles.css settings in the Template tab of the BANS Admin produces no result. I added color codes to all entries, and currently the code looks like this:
/* Contact Us Start */
p#contact {
font-family: Arial;
font-size: 12px;
color: #ffffff;
}
p#error {
font-family: Arial;
font-size: 12px;
color: #ffffff;
}
td#contact i b {
font-family: Arial;
font-size: 12px;
color: #ffffff;
}
/* Contact Us End */
I would like to make the “Contact Us” title white, as well as the field names.
Is there any code I have to add?
Many thanks
I have the solution to my own question, thanks to the helpful people at the BANS forum (http://buildanichestore.com/me.....mp;start=0):
In order to change the entry field titles (like “Name:”, “Subject:”, etc.), just do this:
1. In the styles.css template, insert the following AT THE END of the Contact Us code:
td#contact {
font-size: 1.2em;
color: #ffffff;
}
2. To change the page title color (Contact Us), go to the contact.php file and search for the following code:
Contact Us
and replace with the following: Contact Us
2. In your styles.css file, place the following code near the bottom:
h1#contact {
color: whatever-colour-you-like-here;
}
That did it for me. Thanks you once again for this useful add-on, Rochelle!
Oh no… in my previous post the html codes were not displayed…
So, here again:
2. To change the page title color (Contact Us), go to the contact.php file and search for the following code:
=Contact Us= (remove the = sign)
and replace with the following: =Contact Us= (remove the = sign)
ok… i give up. I can’t get the html codes to display properly – maybe you can help, Rochelle?
Send the code to me in an email and I can put a link to it so that it will show up properly. I’ve run into this problem with several of the codes I’ve shared in various instructions. Frustrating, isn’t it?
Rochelle
Regarding emails. Why not just create folders (for each store) in whatever email prog you are are using (even yahoo or gmail) and then have the emails filtered to each folder. The subject heading of any email from a particular store will have the store’s title in it so there shouldn’t be any problem with filtering. This is my second store and thats how I proposes to tackle the email issue. My first store http://fishing.inthekawarthas.com/fishingstore/ also has the contact us form.
Good idea! Thanks for sharing it.
Rochelle
Hi,
I did everything as directed – no issues.
Well – except that I don’t see it on my site!
Does this create a new page – or where does it show the link?
Hi Ellie,
If you followed all the instructions as above, the link to the contact form should be in your site navigation sidebar. If you’re saying it’s not there you’ve missed step 3 out!
Mick
Hello,
How can you modify the title displayed in the title bar.
Regards,
pyro
Awesome tip. Thanks.
I bet somewhere in contact.php there is a line that can be changed to preset the subject = to something.
This could be set to the name of your store so we would know where the message came from.
If it is easy, can you point out this change?
Pete,
I’m not totally sure what you are asking. Is this regarding the email address? Or something else? Please clarify.
Rochelle
Be able to preload the subject line in the contact form with something like “MyLittlePony” so you would know which store the email came from.
On or around line 216 of contact.php you should see the line
if (!$_POST['submit']) {
add the following lines of code immediately below that line
if (!isset($Subject)) {
$Subject = Trim(stripslashes(SITENAME));
}
That will prepopulate the subject textbox with your site name.
You need to manually edit your header.php file for your chosen template.
Locate the line/code that says
meta();?>
Paste the following lines of code BEFORE the code mentioned above
<?php
if ($PHP_SELF == “/contact.php”) {
echo “Contact “.SITENAME.”";
}
?>
You can edit the text between & to say whatever you want it to.
Hope that helps
Mick
Oops, in my previous post html code was stripped out.
I’ll try again,
Find
meta();?>And add the following BEFORE that code
<?php
if ($PHP_SELF == "/contact.php") {
echo "Contact ".SITENAME."";
}
?>
Sorry, same thing has happened.
You can read the change required here http://www.icehockeycardstore......change.txt
Found the place and added as post said. Uploaded but no go.
Contact form still works and sends emails as it should but no change in the subject line.
You did mean to leave “SITENAME” as is and NOT replace it with something like”MyLittlePony” ??? Correct?
I do not know anything about php but is there maybe 1 extra “)” in there???
Thanks for looking at this.
BTW – The people over at Wordpress would like a contact form like yours with the type in number challenge.
The only contact form they seem to have with a built in challenge question is crude compared to yours.
Yes you leave SITENAME as is.
You have typed the code exactly as shown? There is a ‘!’ right before isset.
Please post your code here for me to have a look at, or send me a PM in the BANS forum.
! is there.
Here is the code as edited and uploaded – copy and pasted…………
if (periodPos+3 > email.length) {
return false
}
return true
}
<?php
if (!$_POST['submit']) {
if (!isset($Subject)) {
$Subject = Trim(stripslashes(SITENAME));
}
$error_char = “”;
$error_text = “”;
if (isset($contact_error)) {
Hi Pete,
Sorry then, but I don’t know what else to suggest.
When I clicked on my Contact Us page after uploading the change, the Subject text box defaulted to my Sitename, so appears to work.
The code you’ve shown looks fine.
I’ll have a think.
Thanks for your efforts.
The message acknowledge email that the person who filled out the form appears to have the line
“Message Acknowledgement from “.SITENAME;
on mine the email I get does Not have the site attached in this email.
Looks like something is missing related to SITENAME.
Maybe I will download a new contact.php and try again.
else {
// send acknowledgement email
$send_to = $EmailFrom;
$send_headers = “From: “.SITENAME.” \r\n”;
$send_headers .= “Content-Type: text/html;”;
$send_subject = “Message Acknowledgement from “.SITENAME;
$send_message = “Hello $Name,Thank You for contacting us.We will respond to your message as soon as possibleRegards“.SITENAME.”“;
mail($send_to, $send_subject, $send_message, $send_headers);
// send contact message
this is what i did to know what site the comment is from.
you will see i added: .comments from: mysite.com. to the code in contact.php.
may be a better way but it does work….
Jeff
// send contact message
$send_headers = “From: “.$Name.” .comments from: mysite.com. \r\n”;
$send_headers .= “Content-Type: text/html;”;
mail(EMAILADDR, $Subject, $Message, $send_headers);
JEFFs last blog post..Guest Blogger Wanted – Squidoo
Jeff,
That’s very clever! Thank you for sharing : )
Rochelle
Hi
"Please contact us to confirm how the details of the other party were optained?" What they are asking for?
Barry,
Sorry, but I don’t understand your question. Where are you seeing that?
Rochelle