Where should we put our php codes inside our HTML structure page, so these two...

Darren

New member
You can generally put php code anywhere in a html structure. But for example, if you wanted php to output data to the webpage, the php code needs to be at the specific point in the html. So, say if you wanted to output customer details from a database in the content div of your site, the php needs to be at this point. <div id="content"><?php echo $mydata;?></div>

Anything that doesnt really output, setting variables for example, is maybe better right at the top of the html structure to make things easy.


http://www.bigpepperdesign.com
 
...things don't mess around ? Where should we put our php codes inside our HTML structure page, so these two things don't mess around & don't mix it up, So, we can debug easily ?

thanks
 
You can generally put php code anywhere in a html structure. But for example, if you wanted php to output data to the webpage, the php code needs to be at the specific point in the html. So, say if you wanted to output customer details from a database in the content div of your site, the php needs to be at this point. <div id="content"><?php echo $mydata;?></div>

Anything that doesnt really output, setting variables for example, is maybe better right at the top of the html structure to make things easy.


http://www.bigpepperdesign.com
 
You can generally put php code anywhere in a html structure. But for example, if you wanted php to output data to the webpage, the php code needs to be at the specific point in the html. So, say if you wanted to output customer details from a database in the content div of your site, the php needs to be at this point. <div id="content"><?php echo $mydata;?></div>

Anything that doesnt really output, setting variables for example, is maybe better right at the top of the html structure to make things easy.


http://www.bigpepperdesign.com
 
You can generally put php code anywhere in a html structure. But for example, if you wanted php to output data to the webpage, the php code needs to be at the specific point in the html. So, say if you wanted to output customer details from a database in the content div of your site, the php needs to be at this point. <div id="content"><?php echo $mydata;?></div>

Anything that doesnt really output, setting variables for example, is maybe better right at the top of the html structure to make things easy.


http://www.bigpepperdesign.com
 
Back
Top