ActaNonVerba1 Posted January 21, 2011 Share Posted January 21, 2011 Hey guys, I'm opening a HTML file from my server, and i can successfully echo it both as code to show the page, and as code which the person can then edit in a <textarea>. However, there are certain sections of the code i do not what echo'd to the page. What is the best way to go about stipping them? For example i do not want the user to be able to edit the doctype, head element, <header> or <nav> sections of the code. Thanks in advance Danny. Link to comment https://forums.phpfreaks.com/topic/225209-how-to-display-only-certain-code-from-an-fopen/ Share on other sites More sharing options...
BlueSkyIS Posted January 21, 2011 Share Posted January 21, 2011 typically the content is stored in a database and PHP is used to add the non-editable elements. alternatively, you could store the content in a separate file and use PHP to add the non-editable elements. in the end, creating individual HTML files and stripping off the non-editable parts, then re-adding them is going to be more difficult than other options. Link to comment https://forums.phpfreaks.com/topic/225209-how-to-display-only-certain-code-from-an-fopen/#findComment-1163111 Share on other sites More sharing options...
ignace Posted January 21, 2011 Share Posted January 21, 2011 strip_tags to strip out all HTML tags, it has an optional argument that allows you to tell which should be kept. Link to comment https://forums.phpfreaks.com/topic/225209-how-to-display-only-certain-code-from-an-fopen/#findComment-1163113 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.