nothing500 Posted May 20, 2009 Share Posted May 20, 2009 Can PHP do this? <html> <?php // Reference that div below me. // Manipulate it. // Write it back in its same location, but with new code around it. ?> <div id="something_to_be_referenced"> Something to be replaced. </div> </html> I'm trying to template my HTML page by referencing the HTML content in PHP, manipulating it as an XML object, then putting it back with the template content wrapped around it. I've done a similar thing by referencing content in an external file, and then writing the manipulated content (the whole page's content, actually) into the current, blank file. Now, I want to get reference to and manipulate an outer-lying HTML tag that's in the same file as the PHP tag. And I've done this with Javascript by waiting for the page to load, then writing a specific tag's inner HTML. Quote Link to comment https://forums.phpfreaks.com/topic/158956-readwrite-to-an-outerlying-html-tag/ Share on other sites More sharing options...
Axeia Posted May 20, 2009 Share Posted May 20, 2009 See the PHP DOM . Similiar to javascript (in which you seem to have solved the problem already) so it should be easy to learn for ya. Quote Link to comment https://forums.phpfreaks.com/topic/158956-readwrite-to-an-outerlying-html-tag/#findComment-838473 Share on other sites More sharing options...
nothing500 Posted May 21, 2009 Author Share Posted May 21, 2009 Ok, so, I'm assuming you're saying it's possible. That's very motivating! PHP's DOM manual was what I've been reading for hours before posting here, but I'll keep going through it. If anyone has any other clues on how to make this happen, that'd sure be nice... Quote Link to comment https://forums.phpfreaks.com/topic/158956-readwrite-to-an-outerlying-html-tag/#findComment-838991 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.