ijyoung
03-09-2008, 12:05 PM
1) Script Title: Ultimate Fadein Slideshow
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.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/archive/index.php/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) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.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/archive/index.php/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