In the following code, I cannot get the $list array to load into the js array (jspgst). Help, anybody?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>aaaaaa</title>
</head>
<body>
<script type="text/javascript">
var jspgst= new Array();
<?php
// file example 1: read a text file into an array, with
// each line in a new element
$filename="linksfile.txt";
$lines = array();
$file = fopen($filename, "r");
while(!feof($file)) {
//read file line by line into a new array element
$lines[] = fgets($file,20);
}
fclose ($file);
//read file line by line into a new array element
foreach($lines as $url){
?>
//store PHP urls into 'pages' JavaScript array
jspgst[jspgst.length]='<?php echo $url?>';
<?php
}
?>
document.write("This is just a check")
</script>
</body>
</html>