Is there a way to pass a variable a javascript that opens a new page. The code I have is as follows
$result = mysql_query ( "SELECT * from mpn_war_games WHERE result = '' ORDER BY e_date ");
while ( $a_row = mysql_fetch_array( $result ))
{
echo "<tr bgcolor=$dcolor>"
."<td width=\"19%\"><div align=\"center\">".date("D j M H:i", $a_row[e_date])."</div></td>"
."<td width=\"23%\"><div align=\"center\">";listclan( $a_row[opp_id] ); echo "</div></td>"
."<td width=\"23%\"><div align=\"center\">";leaguetype( $a_row[league] ); echo "</div></td>";
echo "<td width=\"17%\"><div align=\"center\">$a_row[id]</div></td>";
echo "<td width=\"18%\" align=\"middle\"><div align=\"center\"><form>";
### open new window script ########
echo "<script type=\"text/javascript\">"
."function openwindow()"
."{"
."window.open(\"http://www.nuta.co.uk/wars_games.php?gameid=$a_row[id]\",\"my_new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=400\")"
."}"
."</script>";
#### from to open the page #####
echo "<INPUT type=\"image\""
."name=\"submit$a_row[id]\""
."value=\"Open Window\""
."src=\"images/wars/view.png\""
."onclick=\"openwindow()\">";
echo "</form></div></td>";
}
echo "</tr></table>";
But due to the form being in a loop the output to the new page always gives the last id. I need to remove the part after war_games.php?$a_row[id]. This will always pass the last id
Any ideas would be nice
Thanks if ya can help