Visit the Official PHP Website

Search this Site

PHP Programming

By James N Hitz

Dividing the Code

The main part of our code is made up of 3 main statement blocks decided upon by the by the value of the $action variable:

if($action == 1){
  
  [FIRST STATEMENT BLOCK];
  
} elseif($action == 2){
  
  [SECOND STATEMENT BLOCK];
  
} elseif($action ==3){
  
  [THIRD STATEMENT BLOCK];
}

The first statement block deals with subscription, the second one with unsubscription, and the third with listing the datafile (the afterthought.... remember?).

I'll skip the part that deals with validation and start with the nitty gritty - starting with subscription.

<< From the Top | Code Explanation >>

JamHitz Productions