Here is the code in the PHP file:
Code: Select all
<?
$handle=opendir("\images");
$counter = 0;
while ($file = readdir($handle)) {
$the_type = strrchr($file, ".");
$is_picture = eregi("jpg",$the_type);
if ($file != "." and $file != ".." and $is_picture) {
$picsї$counter] = $file;
$counter++;
}
}
closedir($handle);
for ($i = 0; $i < count($pics); $i++){
$PicsList .= $mypicsї$i] . "|";
}
$PicsList = substr ($PicsList, 0, -1);
echo ("&PicsList=$PicsList&");
?>Code: Select all
varPics = new Array();
varReceiver = new LoadVars();
varReceiver.load("\\findpics.php");
varReceiver.onLoad = function(){
tmp = this.PicsList;
varPics = tmp.split("|");
PicTitle.text = varPicsї0];
};This is whats happeneing:
In the variable 'PicTitle.text', the varaible name from echo is showing up: $PicsList
what am i doing wrong