GETTING USER FEEDBACK
331
8
}
elseif ($_POST && !$mailSent) {
?>
Sorry, there was a problem sending your message.
Please try later.
}
elseif ($_POST && $mailSent) {
?>
Your message has been sent. Thank you for your feedback.
This block of code displays an appropriate message depending on the outcome.
Put whatever messages you like in place of the ones shown here, and add the following
rule to your style sheet:
.warning {
font-weight: bold;
color: #ff0000;
}
If you??™re using a visual HTML editor like Dreamweaver, all three messages will
appear to be displayed at once. However, when you load the page onto your website,
the PHP conditional logic hides all the messages, and only the appropriate one
is displayed after the user submits the form.
13. Save the page and upload it to your hosting company, together with process_
mail.inc.php. Test it. In a few moments, you should receive the test message in
your inbox. That??™s all there is to it!
If you get error messages or a blank screen, it means you have made a mistake in
the script. Check the commas, quotes, and semicolons carefully. If you get a message
saying that process_mail.inc.php cannot be read, it probably means that
you have forgotten to upload it, or that it??™s not in the same folder as the form.
Although these instructions should be sufficient to help you get a PHP form working
successfully, server-side coding can seem intimidating if you??™ve never done it before.
Pages:
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432