js menu met php?..
Ronstert - 09/10/2005 16:12
|
MySQL interesse |
|
Ik heb een menu wat als volgt opgebouwd is!..
Menu1[4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "")
subMenu1[4] = new Array()
subMenu1[4][0] = new Array ("profile", "http://link","_top")
subMenu1[4][1] = new Array ("service", "http://link","_top")
subMenu1[4][2] = new Array ("Feedback m", "http://link","_top")
Menu1 [4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "") subMenu1 [4] = new Array() subMenu1 [4][0] = new Array ("profile", "http://link","_top") subMenu1 [4][1] = new Array ("service", "http://link","_top") subMenu1 [4][2] = new Array ("Feedback m", "http://link","_top")
Hoe kan ik dan die submenu's vullen met (bijv) links uit een database?...!...
|
5 antwoorden
Gesponsorde links |
|
Maarten - 09/10/2005 16:14 (laatste wijziging 09/10/2005 16:16)
|
Erelid |
|
Door de links uit te lezen en dan zo'n submenu[4][cijferhier] te echoen..
<script language="javascript" type="text/javascript">
Menu1[4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "")
subMenu1[4] = new Array()
<?php
$i = 0;
$query = mysql_query("SELECT titel,link FROM navigatie");
while($nav = mysql_fetch_assoc($query)) {
?>
subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top")
<?php
$i++;
}
</script>
<script language="javascript" type="text/javascript"> Menu1[4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "") subMenu1[4] = new Array() <?php $i = 0; $query = mysql_query("SELECT titel,link FROM navigatie"); ?> subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top") <?php $i++; } </script>
|
haytjes - 09/10/2005 16:25 (laatste wijziging 09/10/2005 16:26)
|
JS gevorderde |
|
<script language="javascript" type="text/javascript">
Menu1[4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "")
subMenu1[4] = new Array()
<?php
$i = 0;
$query = mysql_query("SELECT titel,link FROM navigatie");
while($nav = mysql_fetch_assoc($query)) {
?>
subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top")
<?php
$i++;
}
?>
</script>
<script language="javascript" type="text/javascript"> Menu1[4] = new Array("<img src=layout/top_menu/music.jpg border=0>", "") subMenu1[4] = new Array() <?php $i = 0; $query = mysql_query("SELECT titel,link FROM navigatie"); ?> subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top") <?php $i++; } ?> </script>
je was je <?php $i++; vergeten te sluiten |
Rens - 09/10/2005 16:38
|
Crew algemeen |
|
subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top")
subMenu1[4][<?=$i?>] = new Array ("<?=$nav['titel']?>", "<?=$nav['link']?>","_top")
Hoort daar geen ; tussen bij die 3 verkorte echo statements?
subMenu1[4][<?=$i;?>] = new Array ("<?=$nav['titel'];?>", "<?=$nav['link'];?>","_top")
subMenu1[4][<?=$i;?>] = new Array ("<?=$nav['titel'];?>", "<?=$nav['link'];?>","_top")
|
Maarten - 09/10/2005 16:57
|
Erelid |
|
Das optioneel, en als iets optioneel is laat ik het altijd weg. |
Gesponsorde links |
|
Dit onderwerp is gesloten. |
|