<?php somesetupcode(); ob_start(); ?> <html> <body> html text </body> </html> <?php //This will assign everything that has been output since call to ob_start to your variable. $myHTML = ob_get_contents() ; ob_end_flush(); ?>
< script > var check = function () { if ( document . getElementById ( 'password' ). value == document . getElementById ( 'confirm_password' ). value ) { document . getElementById ( 'message' ). innerHTML = '' ; document . getElementById ( 'submit' ). disabled = false ; } else { document . getElementById ( 'message' ). style . color = 'red' ; document . getElementById ( 'message' ). innerHTML = 'not matching' ; document . getElementById ( 'submit' ). disabled = true ; ...