kartul Posted June 30, 2009 Share Posted June 30, 2009 so far I've been making all submit pages with echoing html. example: if(!isset($_POST['submit'])) { echo "<form method=\"post\" action=\"login.php\"> <input .... "; }else { $user = $_POST['user']; $pass ... // and then login part. checking some things and starting session. } as you can see. everything is huge php file with echoed html. as i read from one site, all, html, js, css, php should be separated from each other. so my question is, what is the correct way to display html in php files? Link to comment https://forums.phpfreaks.com/topic/164243-correct-way-of-using-html-with-php/ Share on other sites More sharing options...
rhodesa Posted June 30, 2009 Share Posted June 30, 2009 I've started using Smarty to help separate the PHP logic from the HTML http://www.smarty.net Link to comment https://forums.phpfreaks.com/topic/164243-correct-way-of-using-html-with-php/#findComment-866389 Share on other sites More sharing options...
patrickmvi Posted June 30, 2009 Share Posted June 30, 2009 I would just caution you a bit on using smarty as I've seen some people butcher a smarty template to the point where there was more code in the template than there was in the PHP. The intent of smarty is to have template files with as little coding as possible to allow for the easy editing of HTML to change designs, make sure that if you go this route, you try and keep it that way. Link to comment https://forums.phpfreaks.com/topic/164243-correct-way-of-using-html-with-php/#findComment-866427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.