<?php

// Load up all dem variable... eh... let's do that...

include ("copydir.php");

$pageName = $_POST['pageName'];
$pageName = str_replace (" ", "", $pageName);

$addHTML = $_POST['addHTML'];

// Check if what set is choosen...

copyr('tmp', '../pages/'.$pageName.'');	

//chmod('http://localhost/Big_Bundle/MobileOptimizer/new-dev/pages/'.$pageName.'', 0777);

$v1_contentTXT = '../pages/'.$pageName.'/html.txt';
$v1_contentHandle = fopen($v1_contentTXT, 'w') or die("can't open file");
$sd7 = "$addHTML";
fwrite($v1_contentHandle, $sd7);
fclose($v1_contentHandle);

header('Location: ../index.php');	
?>