Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class RegisterForm
- {
- protected $action;
- protected $method;
- protected $username;
- protected $password;
- protected $confirm_password;
- /**
- * Form is constructed and given an action and a method
- */
- public function __construct($action, $method)
- {
- }
- /*
- * Form is populated so that if it is render()'d it will already contain the field data
- * Expected fields: username (the name of the user) password (the password) confirm_password(the confirmation of the password)
- */
- public function populate($post)
- {
- mysql_real_escape_string($post);
- }
- /**
- * If the form is valid, return true
- * If not, return false.
- * A valid form contains a username and a password, and both password and confirm_password must be identical
- */
- public function isValid()
- {
- }
- /**
- * Return the full HTML code for a valid form; If the form has been populated the fields must contain the correct data
- */
- public function render()
- {
- $html = <<<END
- <html>
- <form action = $this->action method = $this->method >
- First Name: <input type = 'text' name = 'fName'>
- <br />
- Surname: <input type = 'text' name = 'sName'>
- <br />
- Username: <input type = 'text' name = 'uName'>
- <br />
- Password: <input type = 'password' name = 'pWord'>
- <br />
- E-mail: <input type = 'text' name = 'eMail'>
- <br />
- //Submit button.
- <input type = 'submit' name = 'submit' value = 'Register'>
- </form>
- </html>
- END;
- return $html;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement