kOe Posted February 12, 2009 Share Posted February 12, 2009 I`m new to php I started few days ago learning ...I come up with this code for a web page ...is this the right way to do it ? if not what I`m doing wrong ? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>The World Of Lineage 2</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <?php include ("header.html"); ?> <?php include ("menu.html"); ?> <?php $link = $_GET['id']; switch ($link) { case "1": include("info.html"); break; case "2": include("fun.html"); break; case "3": include("members.html"); break; case "4": include("gallery.html"); break; default: include("content.html"); } ?> <?php include ("right.html"); ?> <?php include ("status.html"); ?> <?php include ("footer.html"); ?> </body> </html> menu.html <div id="nav"> <ul> <li class="nlink"><a href="index.php?id=home">Home</a></li> <li class="nlink"><a href="index.php?id=1">Info</a></li> <li class="nlink"><a href="index.php?id=2">Fun Art</a></li> <li class="nlink"><a href="index.php?id=3">Members</a></li> <li class="nlink"><a href="index.php?id=4">Gallery</a></li> <li class="nlink"><a href="forum.html">Forum</a></li> <li class="nlink"><a href="credits.html">Credits</a></li> <li class="nlinkend"><a href="links.html">Links</a></li> </ul> </div> the webpage works fine but I`m not sure if this is the way to do this ... Thx in advace for any reaply ... just dont be to "hard" on me i`m noob Quote Link to comment https://forums.phpfreaks.com/topic/144934-solved-is-this-the-right-way/ Share on other sites More sharing options...
premiso Posted February 12, 2009 Share Posted February 12, 2009 If it works for you, great. One word of advice: <?php include ("header.html"); ?> <?php include ("menu.html"); ?> <?php Change that to: <?php include ("header.html"); include ("menu.html"); No need to go in and out when doing multiple includes. Quote Link to comment https://forums.phpfreaks.com/topic/144934-solved-is-this-the-right-way/#findComment-760529 Share on other sites More sharing options...
kOe Posted February 12, 2009 Author Share Posted February 12, 2009 hmm ...your right ...told you i`m noob this was my first try ...thx for the quick reply Quote Link to comment https://forums.phpfreaks.com/topic/144934-solved-is-this-the-right-way/#findComment-760533 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.