6. Open the confirmation e-mail. There will be (Apache web server)

6. Open the confirmation e-mail. There will be a link at the bottom (or a nonlinked URL if you are using a text e-mail client). 7. Click the link, and it takes you back to the Thank You page, this time thanking you for confirming your subscription. You will get another e-mail informing you about your subscription, with a link that allows you to remove yourself from the mailing list. Don t click that link just yet. First you re going to send an e-mail to the mailing list you just subscribed to. 8. Open admin.php, and then click the link at the bottom, Send a quick message to users. 9. In the Quick Message page, choose the mailing list that you just subscribed to in the previous steps, and enter a subject. Then type a quick message. 10. Click Send Message. 11. Open your e-mail client again, and read the message you should have received. How It Works By now, you know how config.php works. You know why you use it. We won t insult your intelligence by explaining again how it s important to use this file to hold your MySQL connection info and password. We are also going to skip over parts of the code that we ve touched on before. We certainly don t want to bore you! Let s take a look at user.php instead, shall we? user.php Typically, user.php loads empty, without any extra data. Occasionally, you may return to this page from elsewhere and will have the user ID of the person loading the page. In this case, you tack on ?u=x to the end of the URL (where x is the user ID, such as 3). This bit of code detects the presence of that value: if (isset($_GET[ u ])) { and then puts it into a variable: $uid = $_GET[ u ]; and finally looks up the user s e-mail address: $sql = SELECT * FROM ml_users WHERE user_id = $uid ; ; $result = mysql_query($sql) or die( Invalid query: . mysql_error()); If you find a row, grab the e-mail address and stick it into a variable: if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $email = $row[ email ]; } else { $email = ; } 504 Chapter 14
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Leave a Reply