(i had posted this in the coding forum and realized soon after that it belongs in the Newbies board better. I deleted the other post (no replies yet))
Hi all,
I'm still fairly new to PHP so please bear with me. I have a suspicion that my question has been discussed in depth numerous time, but I can't find something with forum search.
I am working on a website that uses Dreamweaver templates--I will not be the only one working on it, so using include() is out of the question, since the other people would like to use Dreamweaver.
One section of the page contains numerous pages that will need to be printed in the future. Short of manually copy pasting the pertinent code into new printer friendly html files, I thought that I could use PHP to parse out the necessary information.
My pages look something like:
<html><!-- InstanceBegin template="template.dwt" codeOutsideHTMLIsLocked="false" -->
// unwanted code and content here
<!-- InstanceBeginEditable name="Site Section" -->
// code and content I want here
<!-- InstanceEndEditable -->
// more unnecessary stuff
The comments indicate the sections of the files that I want and do not want. My idea is to insert a link in each of the pages to a php file that can parse out all of the unnecessary stuff. How would I go about doing this?
I spent some time practicing pattern matching this morning, and think that I can definitely use the <!-- InstanceBeginEditable name="Site Section" --> and <!-- InstanceEndEditable --> to my advantage.
How would I grab all of the source code from a website and turn it into a string? Is there a way that I can specify with GET in the link to the php file all the source of the html file?
I'd appreciate if anyone could advise me on what to do or point me to a previous post.
Thanks!