1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4. <head> 5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 6. <title>Forum Posting</title> 7. </head> 8. <body> 9. <?php // Script 5.7 - handle_post.php #5 10. /* This script receives five values from posting.html: 11. first_name, last_name, email, posting, submit */ 12. 13. // Address error management, if you want. 14. 15. // Get the values from the $_POST array: 16. $first_name = $_POST['first_name']; 17. $last_name = $_POST['last_name']; 18. $posting = nl2br($_POST['posting']); 19. 20. // Create a full name variable: 21. $name = $first_name . ' ' . $last_name; 22. 23. // Get a word count: 24. $words = str_word_count($posting); 25. 26. // Get a snippet of the posting: 27. $posting = substr($posting, 0, 50); 28. 29. // Print a message: 30. print "<div>Thank you, $name, for your posting: 31. <p>$posting...</p> 32. <p>($words words)</p></div>"; 33. 34. ?> 35. </body> 36. </html>