public static function attemp_to_add_person()
 {
     echo 'print_r($_GET)' . "\n";
     print_r($_GET);
     echo 'print_r($_POST)' . "\n";
     print_r($_POST);
     //echo 'print_r($_SESSION)' . "\n";
     //print_r($_SESSION);
     echo '$_SESSION[\'name\']: ' . $_SESSION['name'] . "\n";
     echo '$_SESSION[\'email\']: ' . $_SESSION['email'] . "\n";
     $return_to_url = MailingList_SignUpURLFactory::get_email_adding_html_page();
     if (isset($_GET['add_person'])) {
         $mysql_user_factory = Database_MySQLUserFactory::get_instance();
         $mysql_user = $mysql_user_factory->get_for_this_project();
         $database = $mysql_user->get_database();
         $people_table = $database->get_table('hpi_mailing_list_people');
         if (isset($_POST['name'])) {
             $_SESSION['name'] = $_POST['name'];
         }
         if (isset($_POST['email'])) {
             $_SESSION['email'] = $_POST['email'];
         }
         try {
             $last_added_id = $people_table->add_person($_POST['name'], $_POST['email'], isset($_POST['force_email']));
             $return_to_url->set_get_variable('person_added');
             $_SESSION['last_added_id'] = $last_added_id;
             unset($_SESSION['name']);
             unset($_SESSION['email']);
         } catch (MailingList_NameAndEmailException $e) {
             $return_to_url->set_get_variable('form_incomplete');
         } catch (MailingList_NameTooLongException $e) {
             $return_to_url->set_get_variable('name_too_long');
         } catch (MailingList_EmailTooLongException $e) {
             $return_to_url->set_get_variable('email_too_long');
         } catch (MailingList_InvalidEmailException $e) {
             $return_to_url->set_get_variable('email_incorrect');
         } catch (Database_InvalidUserInputException $e) {
             $return_to_url->set_get_variable('error_message', urlencode($e->getMessage()));
         }
     }
     print_r($return_to_url);
     #exit;
     return $return_to_url;
 }
 public static function render_body_form_add_email()
 {
     $form_email_adding = new HTMLTags_Form();
     /*
      * Form altered by RFI 2007-07-13
      */
     #$form_action = new HTMLTags_URL();
     #
     #$form_action->set_file('/');
     #
     #$form_action->set_get_variable('section', 'plug-ins');
     #$form_action->set_get_variable('module', 'mailing-list');
     #$form_action->set_get_variable('page', 'sign-up');
     #$form_action->set_get_variable('type', 'redirect-script');
     #$form_action->set_get_variable('add_person');
     #$form_action->set_get_variable('return_to', urlencode('/?section=project-specific&page=sign-up'));
     $form_action = MailingList_SignUpURLFactory::get_email_adding_redirect_script();
     #echo 'action="' . $form_action->get_as_string() . "\"\n";
     $form_email_adding->set_action($form_action);
     $form_email_adding->set_attribute_str('method', 'POST');
     //    method="POST"
     //>
     $ul_inputs = new HTMLTags_UL();
     $li_name = new HTMLTags_LI();
     //        <label for="name">Name:</label>
     $label_name = new HTMLTags_Label('Name: ');
     $label_name->set_attribute_str('for', 'name');
     $li_name->append_tag_to_content($label_name);
     //	<input class="name" name="name" type="text" id="name" value="
     $input_name = new HTMLTags_Input();
     $input_name->set_attribute_str('id', 'name');
     $input_name->set_attribute_str('name', 'name');
     $input_name->set_attribute_str('type', 'text');
     //    if ($_SESSION['name']) {
     //        echo $_SESSION['name'];
     //    }
     $input_name->set_attribute_str('value', isset($_SESSION['name']) ? $_SESSION['name'] : '');
     //" size="17" />
     #$input_name->set_attribute_str('size', 17);
     //        <br />
     $li_name->append_tag_to_content($input_name);
     $ul_inputs->add_li($li_name);
     //
     $li_email = new HTMLTags_LI();
     //	<label for="name">Email:</label>
     $label_email = new HTMLTags_Label('Email: ');
     $label_email->set_attribute_str('for', 'email');
     $li_email->append_tag_to_content($label_email);
     //	<input class="email" name="email" type="text" id="name" value="
     $input_email = new HTMLTags_Input();
     $input_email->set_attribute_str('id', 'email');
     $input_email->set_attribute_str('name', 'email');
     $input_email->set_attribute_str('type', 'text');
     //    if ($_SESSION['email']) {
     //        echo $_SESSION['email'];
     //    }
     $input_email->set_attribute_str('value', isset($_SESSION['email']) ? $_SESSION['email'] : '');
     //" size="17" />
     #$input_email->set_attribute_str('size', 17);
     //        <br>
     $li_email->append_tag_to_content($input_email);
     $ul_inputs->append_tag_to_content($li_email);
     if (isset($_GET['email_incorrect'])) {
         $li_force_email = new HTMLTags_LI();
         //<label for="force_email">Force email:</label>
         $label_force_email = new HTMLTags_Label('Force email: ');
         $label_force_email->set_attribute_str('for', 'force_email');
         $li_force_email->append_tag_to_content($label_force_email);
         //<input
         //    id="force_email"
         //    name="force_email"
         //    type="checkbox"
         ///>
         $input_force_email = new HTMLTags_Input();
         $input_force_email->set_attribute_str('id', 'force_email');
         $input_force_email->set_attribute_str('name', 'force_email');
         $input_force_email->set_attribute_str('type', 'checkbox');
         $li_force_email->append_tag_to_content($input_force_email);
         //<br>
         $ul_inputs->append_tag_to_content($li_force_email);
     }
     $form_email_adding->append_tag_to_content($ul_inputs);
     $li_submit = new HTMLTags_LI();
     #    <input class="submit" type="submit" name="Submit" value="Submit">
     $input_submit = new HTMLTags_Input();
     $input_submit->set_attribute_str('id', 'submit');
     $input_submit->set_attribute_str('name', 'submit');
     $input_submit->set_attribute_str('class', 'submit');
     $input_submit->set_attribute_str('type', 'submit');
     $input_submit->set_attribute_str('value', 'Submit');
     $li_submit->append_tag_to_content($input_submit);
     $ul_inputs->append_tag_to_content($li_submit);
     //</form>
     echo $form_email_adding->get_as_string();
 }