How to get a two column layout using PHP_Quickform:
    $colstart = '<tr><td colspan="2"><table><tr><td><table>';
    $colmiddle = "</table></td><td><table>";
    $colstop = "</table></td></tr></table></td></tr>";
    
    
    // Instantiate the HTML_QuickForm object
    $form = new HTML_QuickForm("loginForm", "post" , "/login_post.php", "_self", NULL, TRUE);
    $form->addElement("header", null, "Login to site");
    $form->addElement("html", $colstart);
    $form->addElement("text", "username", "Username:", array("size" => 30, "maxlength" => 30));
    $form->addElement("html", $colmiddle);
    $form->addElement("password", "password", "Password:", array("size" => 30, "maxlength" => 30));
    $form->addElement("html", $colstop);
    $form->addElement("submit", null, "Send");
    $form->display();

How to define javascript strings in php:
This uses a C module for php and is very fast. more info
    echo "var apa = " . json_encode($str) . ";\n";