SirChick Posted August 9, 2007 Share Posted August 9, 2007 what is better to do for security reasons and general better use of coding.. should php files be on their own and have the html files "include" the php file or just have the php with the html ? Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/ Share on other sites More sharing options...
cooldude832 Posted August 9, 2007 Share Posted August 9, 2007 are you saying these index.html <html> <body> some text <?php incldue("phpstuff.php");?> </body> </html> vs index.php <?php incldue("somehtml.html"); ?> It doesn't matter, but the .html can't read php unless your server is told to (its not a default setting) or am i way off what you saying? Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319754 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 its alway better to include html than php it is very clean to see a template having pure html and pure php its clean and very easy to manage Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319760 Share on other sites More sharing options...
SirChick Posted August 9, 2007 Author Share Posted August 9, 2007 why include html and not the other way round just wondering ... Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319762 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 if your serious about organizing your programming structure think about this include is php so it should fall in the php script and for one reason if your working in a team like me you will have a separate job like a designer and developer now the designer dont know about scripting all that he know is lay out (some maybe know but not all) if ever he tries to edit the template you dont have to worry that the script will be affected hmm does it make sense Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319768 Share on other sites More sharing options...
SirChick Posted August 9, 2007 Author Share Posted August 9, 2007 Ok but say i had these options, which is best idea when working in a team: <? <html> Number of Casino's Owned: [ echo "$casinototal"; ]<br> </html> ?> OR <html> <? Number of Casino's Owned: [ echo "$casinototal"; ]<br> ?> </html> OR <html> Number of Casino's Owned: [ <? echo "$casinototal"; ?>]<br> </html> OR <html> Number of Casino's Owned: [ <? includeblahblah ?>]<br> </html> Which one of thoese is best to avoid designers messing it up cos to me i would say the last one but would that work ? Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319789 Share on other sites More sharing options...
trq Posted August 9, 2007 Share Posted August 9, 2007 Yes the last one, and yes it works if short opening tags are enabled on the server. Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319793 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 if you have already include html in you php then use only the variable not the include <html> Number of Casino's Owned: [ <? echo "$casinototal"; ?>] </html> better Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319794 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 i guess thorpe you have to lay your reason why you chose the last are you saying you are going to put an include in your html template???????????????????????????? Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319806 Share on other sites More sharing options...
trq Posted August 10, 2007 Share Posted August 10, 2007 Well the first two are invalid, for starters, and sorry, I didn't read the last two properly. The safest (least php) way to give designers a clean template is to use... <html> Number of Casino's Owned: [ <?= $varname ?>] </html> IMO. Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319816 Share on other sites More sharing options...
SirChick Posted August 10, 2007 Author Share Posted August 10, 2007 dont u need echo ? and i knew some were invalid just wasnt sure where the tags should go Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319818 Share on other sites More sharing options...
teng84 Posted August 10, 2007 Share Posted August 10, 2007 i know that ive seen lots of your post and seems like you old in this field that why i was shuck with your answer by the way can someone tell me what IMO and i guess this is solved Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319821 Share on other sites More sharing options...
SirChick Posted August 10, 2007 Author Share Posted August 10, 2007 IMO = in my opinion SOLVED. Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319823 Share on other sites More sharing options...
teng84 Posted August 10, 2007 Share Posted August 10, 2007 <?="teng"?> is same as <? echo 'teng'?> it a short hand Quote Link to comment https://forums.phpfreaks.com/topic/64163-solved-whats-safest-to-do-in-terms-of-security-and-sensibility/#findComment-319824 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.