<?php

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

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

$header = $_POST['header'];
$nav = $_POST['nav'];
$tmp = $_POST['tmp'];

$reveal = $_POST['reveal'];

// CODE FOR 2 VARIANTS:

$variant1 = $_POST['htmlHere'];
$variant1 = stripslashes($variant1);
$variant2 = $_POST['pageName'];

// SETTING VARIANT CONTENT

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

$v1_contentTXT2 = "../pages/$testName/title.txt";
$v1_contentHandle2 = fopen($v1_contentTXT2, 'w') or die("can't open file");
$sd2 = "$variant2";
fwrite($v1_contentHandle2, $sd2);
fclose($v1_contentHandle2);

$v1_contentTXT3 = "../pages/$testName/header.txt";
$v1_contentHandle3 = fopen($v1_contentTXT3, 'w') or die("can't open file");
$sd3 = "$header";
fwrite($v1_contentHandle3, $sd3);
fclose($v1_contentHandle3);

$v1_contentTXT4 = "../pages/$testName/nav.txt";
$v1_contentHandle4 = fopen($v1_contentTXT4, 'w') or die("can't open file");
$sd4 = "$nav";
fwrite($v1_contentHandle4, $sd4);
fclose($v1_contentHandle4);

$v1_contentTXT5 = "../pages/$testName/tmp.txt";
$v1_contentHandle5 = fopen($v1_contentTXT5, 'w') or die("can't open file");
$sd5 = "$tmp";
fwrite($v1_contentHandle5, $sd5);
fclose($v1_contentHandle5);

$v1_contentTXT6 = "../pages/$testName/reveal.txt";
$v1_contentHandle6 = fopen($v1_contentTXT6, 'w') or die("can't open file");
$sd6 = "$reveal";
fwrite($v1_contentHandle6, $sd6);
fclose($v1_contentHandle6);


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