How to write these in js as those in php, array(), $_GET, and foreach()?
CODE
<?php
$id=$_GET['id'];
if ($id==""){
$id=4;
};
$swftitle = array (
1 => "No Way to Say - 浜崎あゆみ",
2 => "Blue Bird - 浜崎あゆみ",
3 => "Your Color - BoA",
4 => "Everlasting - BoA",
5 => "スビカ- 坂本真綾"
);
$swffile = array (
1 => "http://www.56.com/n_v48_/c20_/3_/2_/syaorantae_/1184307980_518_/282000_/0_/15456902.swf",
2 => "http://www.56.com/n_v164_/c22_/25_/20_/syaorantae_/1184561707_182_/248000_/0_/15548159.swf",
3 => "http://www.56.com/n_v163_/c23_/29_/28_/syaorantae_/118690028465_/296000_/0_/16700641.swf",
4 => "http://www.56.com/n_v164_/c23_/1_/16_/syaorantae_/118723136053_/320000_/0_/16923528.swf",
5 => "http://www.56.com/n_v138_/c28_/4_/6_/syaorantae_/118787613750_/253000_/0_/17406740.swf"
);
$cdate = array (
1 => "2007-07-13 14:26:20",
2 => "2007-07-16 12:55:07",
3 => "2007-08-12 14:31:24",
4 => "2007-08-16 10:29:20",
5 => "2007-08-23 21:35:37"
);
echo <<< EOT
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>$swftitle[$id] - 犬夜叉 時代を越える旅 - 原创MV</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr>
<td height="57" colspan="2"><img src="title_character.gif" width="434" height="57" /></td>
</tr>
<tr>
<td class="pageName">$swftitle[$id]</td>
<td class="bodyText">发布时间:$cdate[$id]</td>
</tr>
</table>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr>
<td align="center">
<script language=javascript>
var url="$swffile[$id]";
url=url.replace("http://www.56.com/n_","");
url=url.replace(".swf","");
url2=url.split('_/');
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="540" height="450">');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<param name="movie" value="http://www.56.com/flashApp/v_player_site.swf">');
document.write('<param name="FlashVars" value="&img_host='+url2[0]+'.56.com&host='+url2[1]+'.56.com&pURL='+url2[2]+'&sURL='+url2[3]+'&user='+url2[4]+'&user_id='+url2[4]+'&URLid='+url2[5]+'&tag=&Subject=&totaltimes='+url2[6]+'&effectID='+url2[7]+'&flvid='+url2[8]+'&56.swf">');
document.write('<param name="quality" value="high">');
document.write('<param name="allowFullScreen" value="true">');
document.write('<param name="bgcolor" value="#ffffff">');
document.write('</object>');
</script/>
</td>
<td>
<table>
<tr><td class="subtitle">播放列表:</td></tr>
EOT;
foreach ($swftitle as $list => $swftitle){
echo "<tr><td><a href=./?id=".$list.">".$swftitle."</a></td></tr>";
}
echo <<< EOT
</table>
</td>
</tr>
</tr>
</table>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr><td>時代を越える旅 <a href=../>返回主页</a> <a href=../>inuyasha.frih.net</a></td></tr></table>
</body>
</html>
EOT;
?>
$id=$_GET['id'];
if ($id==""){
$id=4;
};
$swftitle = array (
1 => "No Way to Say - 浜崎あゆみ",
2 => "Blue Bird - 浜崎あゆみ",
3 => "Your Color - BoA",
4 => "Everlasting - BoA",
5 => "スビカ- 坂本真綾"
);
$swffile = array (
1 => "http://www.56.com/n_v48_/c20_/3_/2_/syaorantae_/1184307980_518_/282000_/0_/15456902.swf",
2 => "http://www.56.com/n_v164_/c22_/25_/20_/syaorantae_/1184561707_182_/248000_/0_/15548159.swf",
3 => "http://www.56.com/n_v163_/c23_/29_/28_/syaorantae_/118690028465_/296000_/0_/16700641.swf",
4 => "http://www.56.com/n_v164_/c23_/1_/16_/syaorantae_/118723136053_/320000_/0_/16923528.swf",
5 => "http://www.56.com/n_v138_/c28_/4_/6_/syaorantae_/118787613750_/253000_/0_/17406740.swf"
);
$cdate = array (
1 => "2007-07-13 14:26:20",
2 => "2007-07-16 12:55:07",
3 => "2007-08-12 14:31:24",
4 => "2007-08-16 10:29:20",
5 => "2007-08-23 21:35:37"
);
echo <<< EOT
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>$swftitle[$id] - 犬夜叉 時代を越える旅 - 原创MV</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr>
<td height="57" colspan="2"><img src="title_character.gif" width="434" height="57" /></td>
</tr>
<tr>
<td class="pageName">$swftitle[$id]</td>
<td class="bodyText">发布时间:$cdate[$id]</td>
</tr>
</table>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr>
<td align="center">
<script language=javascript>
var url="$swffile[$id]";
url=url.replace("http://www.56.com/n_","");
url=url.replace(".swf","");
url2=url.split('_/');
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="540" height="450">');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<param name="movie" value="http://www.56.com/flashApp/v_player_site.swf">');
document.write('<param name="FlashVars" value="&img_host='+url2[0]+'.56.com&host='+url2[1]+'.56.com&pURL='+url2[2]+'&sURL='+url2[3]+'&user='+url2[4]+'&user_id='+url2[4]+'&URLid='+url2[5]+'&tag=&Subject=&totaltimes='+url2[6]+'&effectID='+url2[7]+'&flvid='+url2[8]+'&56.swf">');
document.write('<param name="quality" value="high">');
document.write('<param name="allowFullScreen" value="true">');
document.write('<param name="bgcolor" value="#ffffff">');
document.write('</object>');
</script/>
</td>
<td>
<table>
<tr><td class="subtitle">播放列表:</td></tr>
EOT;
foreach ($swftitle as $list => $swftitle){
echo "<tr><td><a href=./?id=".$list.">".$swftitle."</a></td></tr>";
}
echo <<< EOT
</table>
</td>
</tr>
</tr>
</table>
<table width="760" border="0" align="center" background="../bg_main.gif">
<tr><td>時代を越える旅 <a href=../>返回主页</a> <a href=../>inuyasha.frih.net</a></td></tr></table>
</body>
</html>
EOT;
?>

