AtomicRax Posted November 12, 2010 Share Posted November 12, 2010 I'm trying to develop a website file manager. I want to allow SSI, and would like to handle it specifically.. $regexp = "<!--#include\s[^>]*virtual=(\"??)([^\" >]*?)\\1[^>]*\/-->"; if(preg_match_all("/$regexp/siU", $body, $matches, PREG_SET_ORDER)) { foreach($matches as $match) { $includeFile = $match[2]; } } This snippet shows how you would get the included file path in the SSI code of the website body [ the $body tag ], but I don't need to just find it- I want to replace the SSI code with a simpler code in the HTML that appears in the editor for easy management.. Then switch back from my easier code to the actual SSI code.. Example: Replace <!--#include virtual="/newsManager/output.php"--> With {INCLUDE=/newsManager/output.php} THEN when the user saves the page, Replace {INCLUDE=/newsManager/output.php} With <!--#include virtual="/newsManager/output.php"--> Is there an easy fix or should I just switch to a full blown template engine.. even though this is the only required feature? Link to comment https://forums.phpfreaks.com/topic/218458-template-handling-ssi/ Share on other sites More sharing options...
AtomicRax Posted November 12, 2010 Author Share Posted November 12, 2010 I use $body = str_replace("{TITLE}", $title, $body); to replace the page title.. but that doesn't apply in this case either because I'm trying to get specific information from between the { } to use while modifying the same tag Link to comment https://forums.phpfreaks.com/topic/218458-template-handling-ssi/#findComment-1133345 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.