Hey guys,
There's a little PHP here, but I think this is a javascript issue... I am creating a javascript array, and within a php while() loop, I am adding values to the array and then am trying to output the results. However, what I want outputted to the browser is not being sent.
I am trying to output an image, but it is not happening.
Any ideas why this is happening?
There's a little PHP here, but I think this is a javascript issue... I am creating a javascript array, and within a php while() loop, I am adding values to the array and then am trying to output the results. However, what I want outputted to the browser is not being sent.
I am trying to output an image, but it is not happening.
Any ideas why this is happening?
Code:
<?PHP
/*
Author: David White
Date Started: 02/06/2007
Description: This script will allow a user to browse through pictures
in a directory to select one picture. It will place all of the contents
in a directory into an array which will be displayed one-by-one on the click
of a button.
*/
// Set the Directory Location
$directory = opendir('../premier_images/');
// Put every picture in the directory into an array
echo "<script type=\"text/javascript\">
var output = new Array()
var i = 0;
";
while ($picture = readdir($directory)) {
echo " output[i] = " . $picture . "
document.write('
<div id='+output[i]+' style=\'<!-- display:none;-->align=center;valign=center;\'>
<img src=\'../premier_images/'+output[i]+\'>
<br />
</div>
');
i++;
document.write(i);
";
}
// ignore this next line... it has a php function that I still need to switch over to a javascript function.... it's not causing any problems
echo "</script><br /><br /><input type='button' value='Next Photo' onClick=\"next_photo_gallery('".current($output)."', '".next($output)."')\">";
?>







