Ok i have a problem i cant solve
I have 2 images
image one saved in location x and has name x1
image two is saved in location y and has name y1
Now i want a script that picks up image y1 and replaces x1 with y1 using changeing the name of the image to x1 as well.
this is what i tried so far but it has not work let me know if i am on the right track my php is rusty
// make a note of the current working directory, relative to root.
$directory_self = str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
echo $newImg = file_get_contents('$directory_self/newImage/STC2033375M1.01.jpg');
echo "<br/>";
echo $fp = fopen('$directory_self/images/', 'w');
echo "<br/>";
echo fwrite($fp, $newImg, strlen($newImg));
fclose($fp);
echo "I ran the script the targetImage now looks like this <br/> <img src='images/targetImage.jpg' width='300' />";