i made a script to autogenerate a javascript pice to be used as a link later on the page. option 0 is alredy difined so i need to start adding from 1
i want to have a output like this:
else if (document.stationform.stationselect.options[1].selected)
{ window.location.href = "a link";}
else if (document.stationform.stationselect.options[2].selected)
{ window.location.href = "a link";}
else if (document.stationform.stationselect.options[3].selected)
{ window.location.href = "a link";}
ect....
but every time i run the script it timesout.
could sombody pleace help me to find a solution....
<?PHP
$Query_1 = mysql_query("SELECT * FROM penrdata WHERE type = 'preview' AND zoek = '1'");
$t = 1
for ($t=1; mysql_num_rows($Query_1); $t++)
{
while($r=mysql_fetch_array($Query_1))
{
$link = $r['link'];
$name = $r['name'];
$platform = $r['platform'];
echo("else if (document.stationform.stationselect.options[$t].selected)
{ window.location.href = \"$link\";}");
}
}
?>
Thax in advance
Greetzz
Ramli