Mavent Posted November 17, 2011 Share Posted November 17, 2011 I build almost all my pages in .html and then do my .php calls inside the .html code. A buddy of mine who's also a web developer told me that I'm doing it backwards, and I should be building .php pages and calling .html inside of them. I'm interested in knowing which of us is full of crap. My argument is that it's insanely hard to write .html code inside a .php page. (For me, anyway). Half the time, the page just pops up completely blank, and I have yet to figure out what Magic Word I'm using on the 50% of the time that it actually works. Opinions? Thoughts? Insults? I'm open to all comments... Quote Link to comment https://forums.phpfreaks.com/topic/251323-which-is-better-php-in-an-html-page-or-html-in-a-php-page/ Share on other sites More sharing options...
xyph Posted November 17, 2011 Share Posted November 17, 2011 If you're the only coder, than whatever way is easier for you. In a team environment, you may have to start conforming to more standardized approaches. I prefer to not mix them at all, in a sense. I don't like markup cluttering my code, and I don't like code cluttering my markup. Using a template system like smarty (http://www.smarty.net/) helps you minimize the amount of logic you have in your markup, and keep it away from the PHP code Quote Link to comment https://forums.phpfreaks.com/topic/251323-which-is-better-php-in-an-html-page-or-html-in-a-php-page/#findComment-1289006 Share on other sites More sharing options...
Pikachu2000 Posted November 17, 2011 Share Posted November 17, 2011 If your scripts are returning empty documents, with nothing at all in View ---> Source, you're probably developing with display_errors off. You should develop with all errors displayed. Quote Link to comment https://forums.phpfreaks.com/topic/251323-which-is-better-php-in-an-html-page-or-html-in-a-php-page/#findComment-1289012 Share on other sites More sharing options...
ManiacDan Posted November 17, 2011 Share Posted November 17, 2011 Also note that the file extension is absolutely meaningless. I could name all my files something.poop and just process .poop as php, and everything will work exactly the same. File extensions are a convenience for the user and an instruction for the OS, not something that determines what the file actually IS. Quote Link to comment https://forums.phpfreaks.com/topic/251323-which-is-better-php-in-an-html-page-or-html-in-a-php-page/#findComment-1289021 Share on other sites More sharing options...
Mavent Posted November 17, 2011 Author Share Posted November 17, 2011 If your scripts are returning empty documents, with nothing at all in View ---> Source, you're probably developing with display_errors off. You should develop with all errors displayed. You sir, are a genius. That was exactly it. Thanks to all three of you! Quote Link to comment https://forums.phpfreaks.com/topic/251323-which-is-better-php-in-an-html-page-or-html-in-a-php-page/#findComment-1289049 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.