wiredphp Posted March 31, 2013 Share Posted March 31, 2013 Hi, I'm doing web page menu that will be stored in mysql database called 'menitest' it has 2 fields, menu id (INT) and item (VARCHAR). For now I made index.php and style.css, menu is ul list, connection to database works, and I'm managed to get everythig works. menu is populated from database, and that is fine, but what I need is help to make menu items to links to another pages. here is the code for now. index.php <?phpinclude('testconnect.php');//calling menu from database$query_sql = "SELECT * FROM meni";$item_query = mysql_query($query_sql) or die(mysql_error());$rsitem = mysql_fetch_assoc($item_query);?><! DOCTYPE html><html><head><title></title><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><link rel="stylesheet" href="style2.css" type="text/css" /></head><body><nav> <ul> <?php do { ?> <li><a href="menutest.php?meni_ID=<?php echo $rsitem['meni_ID']; ?>"><?php echo $rsitem['item']; ?></a></li> <?php }while ($rsitem = mysql_fetch_assoc($item_query)); ?> </ul></nav></body></html> menutest.php does not be there, it just page that I use for testig to see if it works... Quote Link to comment https://forums.phpfreaks.com/topic/276355-make-link-php/ Share on other sites More sharing options...
trq Posted March 31, 2013 Share Posted March 31, 2013 What exactly is the issue? Quote Link to comment https://forums.phpfreaks.com/topic/276355-make-link-php/#findComment-1422162 Share on other sites More sharing options...
wiredphp Posted April 1, 2013 Author Share Posted April 1, 2013 I'll try to be more specific. Menu has shown up, as expected but now hot to make item in menu, exampe: home, about, gallery to be links to pages home.php, about.php... how to make menu items to be links.... Quote Link to comment https://forums.phpfreaks.com/topic/276355-make-link-php/#findComment-1422224 Share on other sites More sharing options...
trq Posted April 1, 2013 Share Posted April 1, 2013 The code you have posted should create links. Does it not? Quote Link to comment https://forums.phpfreaks.com/topic/276355-make-link-php/#findComment-1422243 Share on other sites More sharing options...
wiredphp Posted April 1, 2013 Author Share Posted April 1, 2013 i to does, i see the items from database and that is good, but i need them to send me to specific page.if I have home, about, etc I want them to send me, when I click on them to home.php or about.php Quote Link to comment https://forums.phpfreaks.com/topic/276355-make-link-php/#findComment-1422261 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.