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

include ("check_session.php");

$page_name = $_POST['page_name'];
$folder = $_POST['folder'];
	
$document_root = $_SERVER['DOCUMENT_ROOT'];
if ($folder == "pages")
{
	if (BWB_BASE_DIR == '')
		$path = $document_root . "/" . BWB_WEBPAGE_DIR;
	else
		$path = $document_root . "/" . BWB_BASE_DIR . "/" . BWB_WEBPAGE_DIR;
}
elseif ($folder == "scripts")
{
	if (BWB_BASE_DIR == '')
		$path = $document_root . "/" . BWB_SCRIPTS_DIR;
	else
		$path = $document_root . "/" . BWB_BASE_DIR . "/" . BWB_SCRIPTS_DIR;
}
elseif ($folder == "php")
	$path = $document_root . "/php";
else
{
	echo "Error: no folder specified\n";
	exit;
}
	
$file_path = $path . $file_name;
	
if (file_exists($file_path))
	print "1";
else
	print "0";
	
	
?>