Search
Recommended Sites
Related Links






Valid XHTML 1.0 Transitional

Valid CSS!
   

Informative Articles

Controlling Search Engines with Robots.txt
Introduction As mentioned in previous articles, search engines can be great source of traffic to a standard business or personal website. What would happen though, if you didn't want to appear in them? This is the purpose of robots.txt...

Mark P
Five effective ways of making money out of web templates Web templates are the in-thing now-a-days and most of them are selling like hot cakes resulting into huge profits for web template providers. You too can cash-in on this web template craze...

Taking HTML Further with Javascript
Once you've built your HTML pages, you might need them to do something a little more interactive on the client-side (that is, in the visitor's web browser). How can you do that? Javascript is the answer. How Does Javascript Work? To add...

THERE IS NOTHING WRONG WITH USING WYSIWYG EDITORS, IF YOU ALREADY KNOW HOW TO WRITE HTML
This article is not to persuade anyone to change their existing methods of producing websites, nor is it my intention to offend anyone. I wrote this article to defend people who like to use WYSIWYG editors. There really is nothing wrong with using...

Web Application Development
Prototyping is one of the most important aspects of our development process. We consider the act of prototyping to be a risk mitigation strategy. If approached correctly, we believe that prototyping can reduce the risks in development....

 
How to make a simple form mailer with PHP

As you may be well aware, displaying your e-mail address on your website can lead to e-mail harvesters picking up your address and adding it to hundreds or even thousands of lists used by spammers. If you want to allow your website visitors to contact you, but do not want to publicly display your e-mail address, then a form mailer may be exactly what you are looking for.

What is a form mailer? Quite simply, it is a form that you place on your website, that when filled in and submitted, sends you an e-mail with the contents. Below is an example of a simple form mailer written in PHP - feel free to change the information to that of your own website and make use of it:

[WRITE YOUR HTML HEADER HERE]

<?php

if ($_POST[t] == 'process'){

mail('webmaster@yoursite.tld','Your Site Contact Form Submission',stripslashes($_POST[message]),'FROM:'.$_POST[email]);

echo'<p>Thank you, your message was sent to the webmaster.</p>'."\n";

} else {

echo'<form action="'.$_SERVER[PHP_SELF].'" method="post">'."\n";
echo'<input type="hidden" name="t" value="process"></input>'."\n";

echo'Your E-Mail Address:<br /><input type="text" name="email" size="30" value=""></input><br /><br />'."\n";

echo'Your Message:<br /><textarea name="message" cols="30" rows="8"></textarea><br /><br />'."\n";

echo'<input type="submit" value="Send E-Mail"></input>'."\n";
echo'</form>';

}

?>

[WRITE YOUR HTML FOOTER HERE]

To clarify, copy and paste everything from [WRITE YOUR HTML HEADER HERE] to [WRITE YOUR HTML FOOTER HERE] into a text editor such as Notepad. Make your desired alterations. Save as a file with a .php extension (such as contact.php). Upload to your server and link to the file.

About the author:
Rupe Parnell is the founder and lead developer at Starsol.co.uk, a website development and management firm located in Norfolk, England. Rupe specialises in creating professional grade PHP scripts, a selection of which are available free at http://www.starsol.co.uk/scripts/



Sign up for PayPal and start accepting credit card payments instantly.