Get HTML Source of Specific DIV
I'm hoping to get some help on a subject here.
I have a web page, created dynamically. The page is different for each user and is populated based on database records and user input. When you visit the page directly (without first completing the steps beforehand to populate the data) all you get is a message telling you how to access the page.
I want to place PHP code on the final page (once it's been dynamically generated) that copies the final HTML Source from a specific DIV (div id="content") into a variable that I can pass through a form as a hidden field to an external script that will allow me to create a PDF File using that content.
I know about file_get_contents but the problem with this function is it will simply read the URL of the final page and all that will give me is the message about how to access the full features of that page. I need to run this function AFTER the data has been populated and the page is completed. Then I will have the completed HTML Source of the "content" div and I can store it in a valuable to pass through to an external script via a form.