Re: PHP Best Practices



Better... No. Different... Yes.

Read this:

http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

better then me just restating what is there!

Matthew

eholz1 wrote:
Hello, I have a basic design question, in terms of what is "better"
programming.

I have a web site, and am using php pages as includes. some of the php
pages have php tags, and "echo" or "print" the php variables and html.

Like this:
<div id="body">
<?php include("phpincludes/server-nav.php"); ?>
</div>

the php page has code like this:
<div id="header">
<ul>
<li class="tab" <?php if ($thisPage=="Home")
echo " id=\"currentpage\""; ?>>
<a href="http://abf966/LBA/index.php";>Home</a>
</li>
<li class="tab" <?php if ($thisPage=="Introduction")
echo " id=\"currentpage\""; ?>>
<a href="http://abf966/LBA/intro.php";>Introduction</a></li> ...
etc

is it better (or not) to not only echo divs, etc but to create
everything within php tags like this?

<?php echo ('<h2 class="decco" id="hdrTopic">Who We Are Not</h2>'); ?>

OR is this really the same thing, but looks different???

thanks again,

ewholz

.



Relevant Pages

  • Re: PHP Purpose (PHPP) -- largest thread ever
    ... To dicuss purposes of PHP itself and related technologies. ... To discuss programming in general and PHP in particular. ... >>PHP to build a Web site that I have in mind. ... >>will feature political news and other things of interest to people. ...
    (comp.lang.php)
  • Re: A Lot of Questions from a Noob
    ... OOP is a language paradigm that is not specific to ... I Google'd for an introduction to object-oriented programming, ... Watch out for the die-hard Perl fanbois: ... PHP 5 OOP has come a long way from PHP 4. ...
    (comp.lang.php)
  • Re: What Next?
    ... Thanks Peter and everyone who responded, ... create webpages: First, proprietary pages for myself, and second, webpages ... since I want to be able to draw graphs from php. ... of programming and the software ...
    (comp.lang.php)
  • Re: PHP as a secure language? PHP worms? [was: Re: new linux malware]
    ... _Programming Languages: Concepts and Paradigms_ he defines some of the paradigms of programming languages; on pp 12-13, ... This book is classic but doesn't list Perl or PHP or Java -- but the concepts are the same. ...
    (Bugtraq)
  • Re: What is the learning curve for PHP?
    ... I was thinking about learning PHP, ... write scripts that produce client applications like Java? ... I have experience with procedural programming in C, ... PHP is a much higher level language than C. ...
    (comp.lang.php)