Results 1 to 3 of 3

Thread: php array and ultimate fadein slideshow

  1. #1
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default php array and ultimate fadein slideshow

    1) Script Title: Ultimate Fadein Slideshow

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: Cannot get array and script to talk to one another

    I have studied the thread in http://www.dynamicdrive.com/forums/a...p/t-10016.html
    but no matter what I do I cannot get the combined scripts to work.

    The php array works ok on testing separately.
    I have tried all ways to get the script to work. Incorporate the php array into DD script, preload, all sorts but the two scripts don't talk to one another.
    Following scripts are in the head:
    <script type="text/javascript" src="./includes/getphotos2.php?preload"></script>
    <script type="text/javascript" src="./includes/fadeslides.js"></script>

    The php will be familiar,

    <?php
    // gethotos.php
    $directory = "./../pics";

    header("Content-Type: text/javascript");
    $dir = opendir($directory);
    for($i=0;$file = readdir($dir);$i++)
    if(strpos($file, ".") === 0) {
    $i--;
    continue;
    } else if(isset($_GET['preload'])) {
    echo("(new Image()).src = '$directory/$file';\n");
    } else echo("fadeimages[$i]=['$directory/$file', '', ''];\n");
    ?>

    Obviously, I also have the javascript for fadeshow in the html.

    However, I get error that fadeshow is not defined.
    What have I done wrong?

    Cheers

    Ian

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

  3. #3
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you,

    This has been a long and tortuous journey.
    I have put both scripts in off page includes and works a treat.
    See http://www.venachar-lochside.co.uk/photos.html

    Ian

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
  •