I am fairly new to PHP prgramming. I want to be able to create a new page on my website using a template and a form. I tried to adapt code from another thread for my prpose, but cannot get it to work. The form seems to work fine, but the Program returns the following error message when the form calls it:
Warning: Unable to create '/templatetest1.php': Permission denied in /home/a/a/aarda.org/html/test.php on line 14
IT HASN'T WORKED!
the program code is below:
<?php
$pagename = $_POST["pagename"]; // gets the form variable if globals are on or off
$copyFrom = "templates/pagetemplate.php";
$copyTo = "/" . $pagename . ".php";
$hasItWorked = copy($copyFrom, $copyTo);
if($hasItWorked) echo "IT HAS WORKED!";
if(!$hasItWorked) echo "IT HASN'T WORKED!";
?>
Thanks for any help you can give me.