I have completed GUI Package version 0.6. The new GUI system is capable of handling text in containers such as form(form), paragraph(p) and division(div). You can play with text styles to make it bold, italic, underlined, and more. It is also possible to create image and link type GUI components, but not a combined image-link. The new example code is given below:

PHP Code:
<?php

function __autoload($class) {
    
// The autoload function, a bit messy if you ask me
    
$class_path strtolower($class}); 
    if(
file_exists("{$class_path}.php")) include("{$class_path}.php");
    else throw new 
Exception("Fatal Error: Class {$class} either does not exist!");


if(
$_POST['submit']){
    echo 
"Your Username is: {$_POST['username']}";
    echo 
"<br>";
    echo 
"Your Password is: {$_POST['password']}";
    echo 
"<br>";
    echo 
"Your Confirmed Password is: {$_POST['password2']}";
    echo 
"<br>";
    echo 
"Your Email is: {$_POST['email']}";
    echo 
"<br>";
    echo 
"Your Confirmed Email is: {$_POST['email2']}";
    echo 
"<br>";
    echo 
"Your Gender is: {$_POST['gender']}";
    echo 
"<br>";
    echo 
"Your Country is: {$_POST['country']}";
    echo 
"<br>";
    if(empty(
$_POST['username'])) echo "<b>Error: You have not entered a username, please go back and fill in the blank.</b>";
    elseif(empty(
$_POST['password']) or $_POST['password'] != $_POST['password2']) echo "<b>Error: You have not entered a password, or you have not confirmed it successfully.</b>";
    elseif(empty(
$_POST['email']) or $_POST['email'] != $_POST['email2']) echo "<b>Error: You have not entered an email, or you have not confirmed it successfully.</b>";
    else echo 
"<b>You have registered successfully!</b>";
    return;
}

echo 
"<b><u>Registration Form</u></b>";
$form = new Form("myform");
$form->setAction("test.php");
$form->setMethod("post");


$field = new FieldSet();
$field->setLineBreak(FALSE);
$field->add(new Legend("Required Field"));
$field->add(new Division(new Comment("Please enter your username here, it must be alphanumeric."), "username"));
$field->add(new TextField("username""admin"10));
$field->add(new Paragraph(new Comment("Please fill in your password confirmed password here.")));
$field->add(new PasswordField("password""password""123456"));
$field->add(new PasswordField("password""password2"));

$email = new Paragraph();
$email->add(new Comment("Please type your email and confirmed email here."TRUE));
$email->add(new PasswordField("email""email"));
$email->add(new PasswordField("email""email2"));
$field->add($email);


$field2 = new FieldSet(new Legend("Additional Fields"));
$radiolist = new RadioList("gender");
$radiolist->add(new RadioButton("Male""gender""male"));
$radiolist->add(new RadioButton("Female""gender""female"));
$radiolist->add(new RadioButton("Unknown""gender""unknown"));
$radiolist->check("unknown");

$countries = array("Britain""France""Germany""Italy""Spain""America""Canada""Russia""Australia");
$alias = array("gbr""fra""ger""ita""esp""usa""can""rus""aus");
$default "usa";
$dropdown = new DropdownList("country");
$dropdown->fill($countries$alias$default);

$comment2 = new Comment("Your Citizenship: "FALSE);
$comment2->setBold(TRUE);
$comment2->setUnderlined(TRUE);

$field2->add(new Comment("Your Gender: "FALSE));
$field2->add($radiolist);
$field2->add($comment2);
$field2->add($dropdown);

$submit = new Button("Register""submit""submit");
$submit->setLineBreak(FALSE);

$form->add($field);
$form->add($field2);
$form->add(new Image(new Link("templates/icons/facebook.gif"), "facebook"20));
$form->add($submit);
$form->add(new Image(new Link("templates/icons/twitter.gif"), "twitter"20));
echo 
$form->render();
?>
The screenshot for a much more organized and informative PHP form is shown below:
http://oi48.tinypic.com/xzryw.jpg

I am thinking about redesigning the render() method since it is a bit messy and the way it is designed makes it difficult for GUI components inheritance(since all GUI rendering process needs to call the root object's render() method). I also need to find ways to play with font, color and other html elements. It can be a pain, but hopefully I will prevail.

The demo for GUI package v0.6 is available for download, please tell me what you think. Thx.
gui package v0.6.zip