www.webdeveloper.com
Results 1 to 4 of 4

Thread: Tidy up my Images

  1. #1
    Join Date
    Jul 2011
    Location
    Irish Republic
    Posts
    64

    Arrow 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??

    Regards

  2. #2
    Join Date
    Mar 2011
    Posts
    79
    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 :
    Code:
    $image = imagecreatefromjpeg("/album/background$bgNum.jpg");
    
    or 
    
    $image = imagecreatefromjpeg("album/background$bgNum.jpg");
    If its a folder in a directory above the folder containing the file to handle the image it is :
    Code:
    $image = imagecreatefromjpeg("../album/background$bgNum.jpg");
    
    just 2 dots: ".."
    ++ so if your html or php file is inside a folder trying to get to a folder out side used the second.
    ++ 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.

  3. #3
    Join Date
    Jul 2011
    Location
    Irish Republic
    Posts
    64
    Thanks WonDer9, that worked a treat. Thanks also for detailing the options.

  4. #4
    Join Date
    Mar 2011
    Posts
    79
    cool just wanted to be specific.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles