FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Repetetive code question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Repetetive code question [message #179633 is a reply to message #179632] Thu, 15 November 2012 12:31 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 15/11/12 12:26, Dynamo wrote:
> Not sure if this is the right place to ask this question as it is more
> an html query than a php one but here goes anyway.
>
> I have a large chunk of html code that is used to build an extensive
> drop down menu. The same code is used on all 30 of my web pages. So I
> have seperated the code into a txt file called menu.txt and used the
> following php code to get the file contents:
> [
> <?php
> $mymenu=file_get_contents('menu.txt');
> echo $mymenu;
> ?>
> ]
> Everthing works fine but is this good practice and is there a better
> way.
>
>
Seems a neat way to sidestep an ugly problem.

I make my menus an included PHP file..but that's because they do a bit
more than just spit out static HTML.

> TIA
> Dynamo
>


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Scrape dynamically generated hyperlinks
Next Topic: PHP 5.5 and Windows XP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:02:15 GMT 2024

Total time taken to generate the page: 0.05467 seconds