Best way to move files with php
Hey all,
I've created an "Update Item" Page where the user is able to move the item from one catergory to another, however, each item has an image so the image needs to be able to move to the correct folder if the user moves the item.
Here is the code I wrote based on what I have found on the web.
A) It doesn't work
B) I've now learned this could open the site up to massive security risks.
if (array_key_exists('submit', $_POST)) {
$oldPath = $row_rsImages['parentPage'];
$newPath = $_POST['parentPage'];
$file = $row_rsImages['imageURL'];
copy('../images/photography/$oldPath/$file', '../images/photography/$newPath/$file');
}
Any ideas or pointers would be very welcome at this moment in time!
Cheers
T
