Hello everyone,
I have a problemen with using javascript in combination with php.
I want to open a file (more files displayed on a window) in a new window with javascript.
The files I want to open are in a do..while loop (see below)
How do I use javascript in this php script, so that I can open every file in a new window?
I've got the problem it opens everytime the latest file from the database.
Could someone help me?
if ($row = mysql_fetch_array($result)) {
do{
$naam = $row[naam];
$link = $row[link];
$bestand = "$link$naam";
?>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
function NewWindow() {
window.open("<? echo "$bestand"; ?>", "nieuw", "width=790,height=600,top=0,left=0,scrollbars=yes");
}
//-->
</SCRIPT>
<?
echo "
<table width=\"100%\" border=\"0\">
<tr><td width=\"30%\"><a href=\"$bestand\" TARGET=\"_blank\" onclick=\"NewWindow(); return false;\">$naam</a></td><td width=\"50%\">Omschrijving</td></tr>
</table>";