| PHP Tutorial | PHP Resources | PHP Server | |
One of the most common reason for people to like using PHP is that PHP has bunch of pre-build in functions. Lets take a look at this mail( ) function which enables you to send any type of email format such as plain text, HTML or even multipart. In this tutorial, we are going to talk about how to send email in the simplest form, that is plain text. Let's say that you have an order form on your website. What you want is that when your customer submit their form, it will send the data to your mailbox.
In this example, I'm assuming that you have already know basic HTML code, thus, I won't discuss how to create forms and assigning names to it. If you have not know how, you can try to 皜eek help from htmlhelp.com or htmlgoodies.com Before you can send email using PHP, you ought to grab those data submitted on your website. So, you will need few line of code to perform this task. In form example, the first field is named 'subject', second is 'email' and finally 'message'. This fields are uniquely assigned to identify each and every fields within the form. <?php
?> What will PHP do when it come across the code above is to assign each variable with the data submitted on the form using $_POST. However, you can do this directly by calling the name of your variable without using $_POST if you had turn on register_global. This method saves you a few hand typing but involve you in a high security risk. Not recommended. It is better to have register_global off from time to time! Finally, the last line is used to send the mail. The mail( ) function automatically send mail in the following format: mail(to, subject, message, additional_header) <?php
?> |
Optimize Website - Webmasters optimize their site and gain higher search engine ranking Webmaster tools - Free online webmaster toolkits, website reporting and free PHP opensource scripts. Free Photo Hosting - Free File Hosting, Free ZIP file Hosting, Free Image Hosting, Free MP3 Hosting. Stupid Videos - Custom Pimped Motorcycle Pictures, Videos, and Articles Planet Diaz - Programming Community - Online programming resource for programmers all around the world Forectory - Webmaster Directory St Louis Computer NetworkingWebsite Templates - 1000s of Templates $5 - Many Templates to help you build your site!
|
Each and every tutorial published in PHPhelps.com
is originally written by PHPHELPS OWNERS. None of the content is allowed
to be replicated without prior notice to writter. Copyright © 2006 PHPhelps.com |