<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 3/10/2013	ELL

	include ("check_session.php");

	$sValue = stripslashes( $_POST['sValue'] ) ;
	
	$encap_delim = "<!-- WYSIWYG Encapsulation. Modify HTML inside of these comments only.  All code outside of these comments is discarded. -->";
	
	$content_arr = split($encap_delim, $sValue);
	
	$sValue=addslashes($sValue);
	$query = "TRUNCATE " . BWB_TABLE_PREFIX . "page_cache";
	$cnt = $bwb_dbh->exec($query);
	$query = "INSERT INTO " . BWB_TABLE_PREFIX . "page_cache SET id = 1, tmp_page_data = '" . $content_arr[1] . "'";
	$cnt = $bwb_dbh->exec($query);
	
	if ($cnt > 0)
		echo "Preview ready";
	else
		echo "Preview failed";
?>