<?php
  
require_once('epf/main.php');

  class 
DoAddCommentServlet extends Servlet {

    private 
$message;
    private 
$name;
    private 
$email '';

    function 
validate_input() {
      
$this->req_post_string('message'$this->message'Please enter some message text.');
      
$this->req_post_string('name',    $this->name,    'Please enter your name.');
      
$this->opt_post_string('email',   $this->email);
    }

    function 
work() {
      
update(<<<SQL
        INSERT INTO
          `tutor3_comments`
        SET
          `message`='$this
->message',
          `name`='$this
->name',
          `email`='$this
->email'
SQL
      );
      
go_to('');
    }

  }

  
$servlet = new DoAddCommentServlet();
  
$servlet->run();

?>