Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.