my HTML header - any feedback?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I will be building a "template" from this to be included in each page
of a PHP/JS/HTML project i'm starting soon, but I'm curious what other
connoisseurs might think of my layout. Hmm like throwing the GET/POST
processing between the <head> and <body> tags is a new idea, but it
seems logical. Any caveats or anything watch out for?

Any thoughts?


# Header Output, cookies, session, auth, etc...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
# includes for the head section
<!-- other head items, meta tags, javascript, css, title -->

# processing php, ajax requests, POSTS, GETS, etc

# output php/html/etc

Re: my HTML header - any feedback?

Quoted text here. Click to load it

There's no advantage to processing in the middle of the output. It
makes more sense not to separate your code into header and processing
blocks. All processing should usually be done before any output so you
don't end up with spaghetti code.

You may want to look at the Model-View-Controller (Model2 for web)
design pattern, and maybe check out some frameworks such as Code
Igniter or Zend Framework. It should then be clear that processing is
best done before any output.

Good luck,
-Michael Placentra II | PHP5 ZCE

Re: my HTML header - any feedback?

Mike Placentra II wrote:
Quoted text here. Click to load it

Sure there is.  It keeps the processing right where the results are  
being used.  No more spaghetti code than doing everything up front.

Quoted text here. Click to load it

Not necessarily.  And the MVC pattern doesn't necessarily require  
processing be done all at the beginning.

Quoted text here. Click to load it

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: my HTML header - any feedback?

Quoted text here. Click to load it

As others have pointed out, this should be 4.01 Strict for new web
pages; you're also missing the URL.  Here's what you should have
(wrap as appropriate)


Site Timeline