Posted by reandeau on 05/31/06 16:46
What you should do is have PHP create the page that contains your
Javascript and applet. Have it load all of the file names from the
text file and store them in a Javascript array. That way you don't
have to reload your page each time you need the next file name. Here
is an example of what the code might look like:
<?php
echo "html and javascript header tags go here";
echo "var imageFiles=new Array()";
//load the file into a Javascript array
$fp = fopen("file.dat", "r");
while (!feof($fp)) {
$lineContent = fgets ($fp, 4096);
echo "imageFiles.push = ('$lineContent')";
}
echo "The rest of your javascript and html code goes here";
?>
Thats about it, let me know how it goes.
Jon Tjemsland
Navigation:
[Reply to this message]
|