Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 23rd, 2004, 02:52 AM
Authorized User
 
Join Date: Apr 2004
Location: malacca, malacca, Malaysia.
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to junemo
Default 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.

Reply With Quote
  #2 (permalink)  
Old April 23rd, 2004, 03:47 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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/
Reply With Quote
  #3 (permalink)  
Old May 7th, 2004, 10:41 AM
Authorized User
 
Join Date: Apr 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to coitri Send a message via MSN to coitri Send a message via Yahoo to coitri
Default

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

Coitri

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down menu mizlatic BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 February 11th, 2008 07:02 AM
Drop down menu antoneath Beginning PHP 1 January 27th, 2006 08:45 AM
drop-down menu crmpicco Javascript How-To 1 March 22nd, 2005 01:23 PM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM
drop down menu scrowler Javascript 1 January 27th, 2005 05:44 AM



All times are GMT -4. The time now is 05:26 AM.


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