Make a contact form

A contact form is easy to create and integrate into an existing website. Simple contact forms can be very beneficial for most websites. They enable simple communication between yourself and any visitors to your site.

Contact forms for WordPress

There are a few ways to take advantage of a contact form. If you’re currently using WordPress, there are different plugins available. Learn some tips and tricks for WordPress contract forms.

Contact forms in PHP 

PHP usage is common across the Internet. The nature of PHP makes it both easy to use & deploy on existing websites. Similar to JavaScript, PHP can be embedded into existing HTML on the server side but unlike JS it does not utilise JIT compilation. Both PHP and JavaScript can be run server-side, retaining functionality whilst obscuring the original code from visitors reducing the potential to be reverse-engineered.

How can I create my own PHP contact form?

1. A good starting point for your PHP form is this article

2. To get this form to work with our hosting properly, you will need to set the “From” address in the code as below:

3. Where the code says:

mail($to,$subject,$message,$headers);<br />

3. You need to add the from address in this format:

mail($to,$subject,$message,$headers,&#8221;-f;);<br />

4. The address should be configured on your server.

SPAM from unsecured contact forms

Contact forms can be a blessing. They’re a great tool for communicating with visitors to your site. Allowing potential customers to enquire before purchasing and allowing contact between businesses, enabling B2B sales.

However, contact forms have the potential to become a curse. Unsecured contact forms are one of the most common attack vectors we see at Unlimited. If left unsecured, a contact form can easily fall victim to an attack, with spammers tricking your contact form into sending out thousands of spam emails.

At Unlimited Web Hosting, we have robust spam detection systems. We monitor all outgoing traffic across our shared services to determine whether it is legitimate. Illegitimate traffic could cause a disproportionate amount of load across the shared server. Therefore, sending sites run the risk of suspension.

Luckily, preventative actions such as securing with a captcha are relatively simple to implement. A few captcha providers exist but to name a few examples: