Is this is far as you would go regarding Object Oriented PHP or can i improve it further by putting HTML into a class? How would i go about doing that? Note: The code below is using a QuickForm by PEAR. Thanks in advance.
<?php
//MySQL class
require_once('database/class.mysql.php');
//Session class
require_once('session/class.session.php');
//SignUp class
require_once('access/class.signup.php');
//QuickForm class
require_once('HTML/QuickForm.php');
//PHPMailer class
require_once('thirdparty/phpmailer/class.phpmailer.php');
//Instantiate the MySQL class
require_once('database/dbconnect.php');
$db = &new MySQL($host, $dbUser, $dbPass, $dbName);
//Instantiate the Session class
$session = new Session;
?>
<html>
<head>
<title>Test page</title>
</head>
<body>
<?php
//Instantiate Quickform
$form = new HTML_QuickForm('regForm', 'POST');
///Header
$form->addElement('header', null, 'Quickform tutorial example!');
//First name
$form->addElement('text', 'fname', 'First name:', array('size' => 30));
$form->addRule('fname', 'Please enter your first name', 'required', null, 'client');
//Last name
$form->addElement('text', 'lname', 'Last name', array('size' => 30));
$form->addRule('lname', 'Please enter your last name', 'required', null, 'client');
//Password
$form->addElement('password', 'pass', 'Password: ', array('size' => 30));
//Gender
$form->addElement('radio', 'sex', 'Gender: ', 'Male', 'male');
$form->addElement('radio', 'sex', '', 'Female', 'female');
//County
$form->addElement('select', 'county', 'County:', array(
'0' => 'Select',
'1' => 'Louth',
'2' => 'Meath'
));
//Date of Birth
$form->addElement('date', 'dob', 'Date of Birth:', array('format' => 'dMY', 'minYear' => 1950, 'maxYear' => date('Y')));
//Submit
$form->addElement('submit', null, 'Submit');
//Try to validate the form
if ($form->validate()) {
echo 'Hello';
}
//Output the form
$form->display();
?>
</body>
</html>