diff --git a/index.php b/index.php index eefee55..c7688c7 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,7 @@ +

Variables for web page

- +
Site name:
diff --git a/make.php b/make.php index dd4659e..5305f28 100644 --- a/make.php +++ b/make.php @@ -5,34 +5,38 @@ $pcolour = $_POST['pcolour']; $scolour = $_POST['scolour']; - $template = fopen("template/template.html", "r+"); - $tempContents = fread($template, filesize("template/template.html")); + $template = fopen("template/template.html", "r+"); // Change this if you have a custom template filename + $tempContents = fread($template, filesize("template/template.html")); //Read frin tge file + // Keywords for replacement - see README $keywords = array("rep_PCOLOUR", "rep_SCOLOUR", "rep_SNAME", "rep_URL", "rep_DEVNAME"); $replacement = array($pcolour, $scolour, $sname, $surl, $devname); + // --- - $contents = str_replace($keywords, $replacement, $tempContents); + $contents = str_replace($keywords, $replacement, $tempContents); // Replace the contents of the variable fclose($template); - /* - echo " "; */ - echo $contents; - - $indexfile = fopen("index.html", "w"); - fwrite($indexfile, NULL); - fclose($indexfile); + echo $contents; // Echo out the generated page + + /* Not actually needed but may need to reuse this code later on + * + * $indexfile = fopen("index.html", "w"); + * fwrite($indexfile, NULL); + * fclose($indexfile); + * + */ header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename=index.html'); - readfile("index.html"); + readfile("index.html"); // Make the client download the file as a .html :) ?> \ No newline at end of file diff --git a/template/template.html b/template/template.html index c71fdfb..c284daa 100644 --- a/template/template.html +++ b/template/template.html @@ -1,4 +1,5 @@ + @@ -41,7 +42,7 @@
-

rep_URL is being worked on by rep_DEVNAME!

+

rep_URL is being worked on by rep_DEVNAME!

\ No newline at end of file