I would like to be able to dynamically create HTML elements (text boxes, labels, buttons, etc) using DOM. Can this be done?
I know that I can create the entire page from scratch using DOMDocument, but I just want to insert elements by creating php objects that implement DOM elements.
For example, if I am in an page, lets say test.php, I want to, in php code, create a textbox. So I need to get a reference to the document (would this be $_SERVER['PHP_SELF']??? and then call createElement('input').
Code: Select all
$doc = $_SERVER['PHP_SELF'];
$doc.createElement('input');
I need to do this to standardize some things in my environment.
Can anyone point me in the right direction?
Thank You,
Mike