Web hosting domains - However, the user.php form forces you to take
However, the user.php form forces you to take one extra step. You get the mailing list ID from the mailing list choice, but you have only an e-mail address for the user. Therefore, you will need to do a lookup with that e-mail address. As you ll no doubt recall, the Remove button on user.php loads the user_transact.php page, and when the action is Remove, you do a lookup for user_id based on the e-mail address, and build the URL for remove.php. You then redirect the user to remove.php with the correct parameters. Time for remove.php to do its job! You can t just assume that remove.php received the appropriate variables. You test to ensure they are set and run the DELETE query. if (isset($_GET[ u ], $_GET[ ml ])) { $sql = DELETE FROM ml_subscriptions . WHERE user_id= . $_GET[ u ] . AND ml_id= . $_GET[ ml ]; $result = mysql_query($sql, $conn); } else { die( Incorrect parameters passed for deletion ); } That was easy, but you still need to do a couple of things, like build the page. Don t quit on us now. Of course, first, you must make sure the deletion worked. Announce the results in big letters! if ($result) { $msg =
Removal Successful
; } else { $msg =
Removal Failed
; } Using the mailing list id, you do a lookup for the name of the mailing list and build the page s message: $ml_id = $_GET[ ml ]; $sql = SELECT * FROM ml_lists WHERE ml_id = . $ml_id . ; $result = mysql_query($sql) or die( Invalid query: . mysql_error()); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $msg .= You have been removed from the . $row[ listname ] . mailing list.
; } else { $msg .= Sorry, could not find Mailing List id#{$ml_id} ; } Finally, you add a link back to user.php at the bottom of the page and echo it to the screen. $msg .= Return to Mailing List Signup page ; echo $msg; 513 Mailing Lists
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.