Tidy up my Images
I have a list of 10 small images that facilitate the background assembly for a captcha PHP script. It would be good to put all the background images in a folder out of view.
The line of script is as follows:
$image = imagecreatefromjpeg("background$bgNum.jpg");
I have tried putting the images in a folder called 'album' and amending the script as follows:
$image = imagecreatefromjpeg(" ./album/ background$bgNum.jpg");
It did not work. Am I on the right track??:confused:
you have to use ".." for an above directory. and "/" for below( or inside folder).
So if your trying to grab images form a folder within you directory it has to be :
If its a folder in a directory above the folder containing the file to handle the image it is :
$image = imagecreatefromjpeg("/album/background$bgNum.jpg");
$image = imagecreatefromjpeg("album/background$bgNum.jpg");
++ so if your html or php file is inside a folder trying to get to a folder out side used the second.
$image = imagecreatefromjpeg("../album/background$bgNum.jpg");
just 2 dots: ".."
++ if your html orr php file is in the main trying to retrieve from a folder use the first.
++ PHP dosen't always care about white spaces but try not to leave it between arears of type.
Thanks WonDer9, that worked a treat. Thanks also for detailing the options.
cool just wanted to be specific.