Jump to content

[SOLVED] html or php?Design doubt


freebsdntu

Recommended Posts

Hi guys,I am having a bit of design doubt here. Should I write all the code in php file? Or should I present the presentation(i.e. forms) in plain html file and create another php file for the server-side functionality(i.e.form handling?)? Which approach is better? Any hints?

Link to comment
https://forums.phpfreaks.com/topic/81912-solved-html-or-phpdesign-doubt/
Share on other sites

I've been starting to create everything in php files. That doesn't mean everything has to be php, but in the event that you want to add php to a page later, it is easier to have the page already set up for it. That way you don't have to use 301 redirects and worry about changing links in your other pages.

Oh,by the way,sKunKbad.If all put in php,do you do it like this?(use php also to echo the html elements)

<? php
echo "<html></html>"
?>

 

or like this?(php embeded in html where neccessary)

 

<html>
<?php
?>
</html>

 

No you would not need to.  You can simple put the html into the php and put bits of <? phpstuff ?> where ever.  You can even do stuff like,

<?php 
if($a=0){
echo "hah";
?>
html STUFF!!! RAW HTMLZZ1!11!
<?php
} else {
echo "Nahh to lazy for more html";
}

 

Hope you understand. :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.