html - How to get the current state of DOM in PHP? -
i have annoying problem. have dynamic website users can create kind of elements. example: start empty list this.
<div id="list"> <ul> </ul> </div>
then can add list items it. can click print button send list server , create pdf them. works when list not created dynamically. when try real code dynamic html element creation php file not "see" these created elements because looking @ index.html
on server.
this code works on static pages:
<?php require('/mpdf/mpdf.php'); $html = file_get_contents("index.html"); $stylesheet = file_get_contents('css/style.css'); $dom = new domdocument; $dom -> loadhtml('$html'); $save = $dom -> savehtml('$dom'); $list=explode("<div id=\"list\">",$save); $list=explode("</div>",$list[1]); $mpdf = new mpdf(); $mpdf -> writehtml($stylesheet,1); $mpdf -> writehtml($list[0],2); $mpdf->output(); exit; ?>
how can give php updated version of dom? in advance!
Comments
Post a Comment