Results 1 to 3 of 3

Thread: Slideshow No Longer Works

  1. #1
    Join Date
    Jan 2006
    Posts
    169
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Slideshow No Longer Works

    First, let me start by saying that I'm not a PHP programmer. Several years ago one of the forum members wrote some PHP code for me and it worked fine.

    Recently, the company that provided our hosting service was bought out and now the code no longer works.

    The purpose of the code is to display sets of photos located in different folders. The display is actually handled by 3 different PHP routines. I've attached them in a zip file to save space in this post.

    The first, ShowScenes1, merely sets up the display area. Essentially just a bordered table.

    The second, showscenedefs, actually does the displaying of the photos. It uses the third, newbuild_array, to create the arrays of photo file names in alphabetical order.

    I think the problem is that now, the newbuild_array can't find the photo folders.

    I believe that the problem is the way showscenedefs is passing the addresses of the photo folders. It appears to be absolute and, I think, tailored to our previous hosting service.

    I've tried a couple of different ways to address for folders, pretty hit and miss, but no luck.

    I'm hoping that someone can come up with a way to make the addressing more generic and server independent.

    Thanks in advance for any help you can provide.

    Jim
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2015
    Posts
    77
    Thanks
    0
    Thanked 18 Times in 18 Posts

    Default

    $_SERVER['DOCUMENT_ROOT'] should exist and be set to the correct path for your document root folder. You can create a simple .php script to echo that value to see if it is. If it isn't set or isn't correct, you can set it yourself in the code to the correct value.

    The php statements that call imageSlideArray() can then use $_SERVER['DOCUMENT_ROOT'] in place of the hard-coded path.

  3. #3
    Join Date
    Jan 2006
    Posts
    169
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Hello DyDr.

    Thank you so much for your help. I put a routine together to echo the results of the $_SERVER['DOCUMENT_ROOT'] and replaced the current addressing and it worked fine.

    So I didn't have to fool with it again, I changed the address line to <?php imageSlideArray($_SERVER['DOCUMENT_ROOT'] . '/Graphics/ShowPics/Spring_2018/' ..... and it worked first time out of the box.

    I still don't quite understand why it needed the absolute address as all the routines were on the same server and website file set.

    Again, many thanks.
    Jim

Similar Threads

  1. Replies: 16
    Last Post: 07-18-2013, 12:13 PM
  2. Resolved This script no longer works
    By ajfmrf in forum JavaScript
    Replies: 3
    Last Post: 01-20-2012, 05:11 AM
  3. Login no longer works
    By ChroniX in forum PHP
    Replies: 2
    Last Post: 06-12-2010, 12:26 PM
  4. gAjax RSS Feeds Displayer no longer works
    By encybr in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 01-08-2008, 11:34 PM
  5. Replies: 3
    Last Post: 05-19-2007, 10:43 AM

Bookmarks

Posting Permissions

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