Visit the Official PHP Website

Search this Site

PHP Programming

By James N Hitz

The Interface

The user Interface though which members subscribe and unsubscribe through is simple and straightforward:

<html><head><title>PHP Mailing List</title></head>
<body>
<h2>PHP Mailing List</h2>
<p>When subscribing, all the fields are required.  When un-subscribing, 
   only specify your email 
<form action="http://localhost/php-bin/mail_lst.php" METHOD=POST>
<table border="0">
<tr><td align="right">First Name:</td>
    <td><input type="text" name="fName"></td></tr>
<tr><td align="right">Last Name:</td>
    <td><input type="text" name="lName"></td></tr>
<tr><td align="right">Email Address:</td>
    <td><input type="text" name="mail"></td></tr>
<tr><td colspan="2">
    <input type="radio" name="action" value="1" checked>Subscribe 
    <input type="radio" name="action" value="2"        >UnSubscribe
</td></tr>
<tr><td colspan="2">
    <input type="reset"  value=" clear "> <input type="submit" value=" ok ">
</td></tr></table>
</form>
</body></html>

Take note of the facts that:

  1. The code is tested on a local server hence "localhost"
  2. The ACTION script is placed in a php-bin folder
  3. The form's METHOD property is set to POST
  4. The two radio buttons have the same name (action), they have different values and one of them is checked by default.

This is all HTML... there's nothing to explain. Now to the code...

<< Reaping Time | The Code - mail_list.php >>

JamHitz Productions