p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning PHP (http://p2p.wrox.com/forumdisplay.php?f=95)
-   -   drop down menu (http://p2p.wrox.com/showthread.php?t=12182)

junemo April 23rd, 2004 02:52 AM

drop down menu
 
hi,
i want create a menu bar (hav sub-menu item) at page header so i don't need repeat to write the code again to displays the menu at each page. So, how i want to do it with php language? Please give me some example and attach the soucre code to me.

Thanks a lot.


nikolai April 23rd, 2004 03:47 PM

Well, if your menu bar is plain HTML, you can save that HTML in a separate file (menu_bar.html might be a good name), and just include it in your PHP script:

<?php
echo "<html>....<body>";

include("menu_bar.html");

?>


However, you're really talking about page templates. A template is a basic layout for a page that specifies where everything goes, what colors, images, etc. belong on a page, but does NOT contain content.

There are many ways of using templates. I suggest starting with SMARTY to learn about PHP-driven templates.
  http://smarty.php.net/



Take care,

Nik
http://www.bigaction.org/

coitri May 7th, 2004 10:41 AM

Hi Nik,
Have you got the guiding document of SMARTY?
If yes, pls share it!
Thanks in advance!

Coitri



All times are GMT -4. The time now is 04:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.