Hi djr33,
Thanks for the help, the code I'm using is:
PHP Code:
$source_file = '../products/template.php';
$dest_file = '../products/' . @$_POST['product_code'] . '.php';
copy($source_file,$dest_file);
chmod ($dest_file, 0777);
The chmod seems to work fine and the file attributes show up in my FTP client as:
-rwxrwxrwx (which is 777 as far as I'm aware?)
As for the code inside the actual file, that is 100% in tact. I've downloaded the copied file (/products/testprod1.php in this case) and it's contents are exactly the same as the template file which it is a copy of.
I'll have a look at character encoding and also take a look at the php.net site to see if that has any answers, thanks for the suggestions!
On an aside, another related problem, I *was* trying to create a directory for the products ( ie. www.mydomain.com/products/testprod1/) and store all images and the actual product info in there, I can create the directory fine using:
PHP Code:
mkdir("../products/" . $product_code, 0777);
However, I can't copy files into it (howeverI can save image files through a file upload into this newly created directory)... which leads me to believe both these problems are some kind of permission problem?
Ta,
Stu
Bookmarks