7. Open your e-mail client and check your (Web site translator)

7. Open your e-mail client and check your e-mail (which should look like the one shown in Figure 11-3). Figure 11-3 How It Works We assume that you know HTML well enough that we don t have to explain postcard.php in great detail. Just remember that if your sendmail.php page is not in the same folder as postcard.php, you have to provide the correct path:

Once the user presses the Send button, sendmail.php is loaded. The first step in your PHP code assigns all the fields from postcard.php to variables. This step is not necessary if register_globals is set to On in your php.ini file, but we strongly recommend you use this code anyway, in case register_ globals is ever turned Off: $to = $_POST[ to ]; $from = $_POST[ from ]; $subject = $_POST[ subject ]; $message = $_POST[ message ]; To specify from whom the e-mail is coming, use the optional fourth parameter for the mail() function, headers. Headers are explained in more detail in the section Sending HTML by Using Headers, later in this chapter. $headers = From: . $from . rn ; 330 Chapter 11
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply