All pastes #14377 Raw Edit

Anonymous

public php v1 · immutable
#14377 ·published 2005-06-13 20:53 UTC
rendered paste body
class billing{  function billing()  {    $this->form = new Form();    $this->form->AddTextBox('phone_number', 'Phone Number:', new PhoneNumValidator());    if (sizeof($_GET) == 0)    {      $this->form->output(); // show the form to the user    }    elseif (isset($_GET['validate']))    {      $field = $_GET['fieldname'];      $value = $_GET['value'];      if ($this->form->validate($field, $value))      {        echo '1';      }      else      {        echo '0';      }      echo $field;      die();    }  }}Class PhoneNumValidator{function validate($data){// return true or false}}