Specifications
mail($toaddress, $subject, $mailcontent, $fromaddress);
?>
<html>
<head>
<title>Bob’s Auto Parts - Feedback Submitted</title>
</head>
<body>
<h1>Feedback submitted</h1>
<p>Your feedback has been sent.</p>
</body>
</html>
String Manipulation and Regular Expressions
C
HAPTER 4
4
S
TRING
M
ANIPULATION
95
LISTING 4.1 Continued
FIGURE 4.1
Bob’s feedback form asks customers for their name, email address, and comments.
Note that generally you should check that users have filled out all the required form fields
using, for example,
isempty(). We have omitted this from the script and other examples for
the sake of brevity.
In this script, you’ll see that we have concatenated the form fields together and used PHP’s
mail() function to email them to feedback@bobsdomain.com. We haven’t yet used mail(),so
we will discuss how it works.
06 7842 CH04 3/6/01 3:41 PM Page 95