|
Code Organization: PHP Calcs Before HTML?
Okay so I am having problems organizing my PHP and HTML code. I realize that to include variables and whatnot one will have to insert some PHP code into the body of the HTML but I was curious: does anyone here insert the MySQL queries and other calculations before most of their HTML code?
It's just becoming a bit of a nightmare when I'm using echo for most of my HTML and I'm wondering if I should have most of my HTML hard-coded in there and just insert the smaller parts of the PHP code (while leaving as much as possible of the PHP code at the beginning.
How do you guys organize you code within a file? I suppose I could even do some of the PHP separately and include it at the top. I typically put Javascript at the bottom.
Would love to hear some of your habits.
|