This is the link to the e-mail (Web hosting servers) portion
This is the link to the e-mail portion of the admin s functions, which is pretty self-explanatory: Send a quick message to users You should be able to figure out quickmsg.php fairly easily. Most of it is HTML, and the PHP code is practically identical to the code used to build the select in admin.php. Feel free to cannibalize your own code as often as you need. If you are scratching your head and trying to remember exactly how class.SimpleMail.php works, now would be a good time to take a break and go check out Chapter 11. There s an analysis of the script toward the end of the chapter. Finally, you come to the real workhorse of the Mailing List Administrator application, admin_ transact.php. This page is the one to which you post your forms, and it will process that information, update the database tables, and send out e-mails as required. Let s take a look under the hood: require( config.php ); require( class.SimpleMail.php ); Remember seeing the preceding line in admin.php? Having your connection data in one file and including it in each page makes your code much more efficient. The same applies to the SimpleMail include. Of course, you already knew that. Let s move on to create the connection to the database, and select it so that you can work with it: $conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die( Could not connect to MySQL database. . mysql_error()); mysql_select_db(SQL_DB, $conn); Did the user click an action button? if (isset($_POST[ action ])) { Depending on which button was clicked, you re going to perform one of three actions: create a new mailing list, delete an old mailing list, or send a message to the users subscribing to a mailing list: switch ($_POST[ action ]) { Not only must you delete the mailing list, like this: case Add New Mailing List : $sql = INSERT INTO ml_lists (listname) . VALUES ( . $_POST[ listname ] . ) ; mysql_query($sql) or die( Could not add mailing list. . mysql_error()); break; case Delete Mailing List : $sql = DELETE FROM ml_lists WHERE ml_id= . $_POST[ ml_id ]; mysql_query($sql) or die( Could not delete mailing list. . mysql_error()); 494 Chapter 14
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.