[prog] Using PHP to create the static part of HTML pages

April april at farstrider.org
Tue May 10 23:28:39 EST 2005


It's a viable way of doing things, though I might not be clear on what 
you want to do.

If you just call a file yada.php but have no actual <?  ?>  tags in it, 
the performance hit is pretty minor... Not enough that you'd care about 
it except on extremely high traffic sites.  Calling everything in a site 
.php when some of it could be .html is common and a good idea.  If you 
are going to use PHP to generate a menu, generate image URLs, etc., 
throughout every page, you might run into a problem on an overpopulated 
or old server... but even then, probably not.  If you mean that you 
moved every single HTML tag on the page into a PHP write statement, then 
the chances are much higher that you'll notice performance problems if 
you start getting traffic.  Personally, I'd advise against that one.

Of course I know nothing about your project, but my personal experience 
has been that maintaining sitewide PHP generated menus can end up as 
time consuming as maintaining HTML with the proper tools.  What if you 
want to add a link offsite to the menu?  You add a new folder?  You want 
to move half of the menu to the right side of the page?  It doesn't mean 
you shouldn't do it.. just try to think of that stuff before you get 
everything planned out.





Gareth Anderson wrote:

>Hi everyone,
>
>Just a quick question, because I keep changing my mind about things in
>my project, what I've done is for now to move all the HTML generation
>into the PHP scripts?
>
>This is simply for myself maintaining things so I don't have to make
>the changes in PHP scripts more than once and so I can say print the
>same menu on each page.
>
>Is there any performance hit for doing this?
>
>For example I could convert some of these pages back to plain HTML
>once I've finalized things, however its easier to maintain in PHP at
>the moment.
>
>For example the login page could be HTML, but as soon as its submitted
>it would have to run the PHP, and if the login failed I would have to
>generate that login page again anyway...
>
>Please tell me if I'm not being clear about what I'm asking :)
>
>Regards,
>Gareth
>_______________________________________________
>Programming mailing list
>Programming at linuxchix.org
>http://mailman.linuxchix.org/mailman/listinfo/programming
>
>
>
>
>  
>



More information about the Programming mailing list