Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can I separate PHP and HTML code
04-18-2009, 06:11 PM
Post: #1
Can I separate PHP and HTML code
I want to separate PHP and HTML code ,So that if i have to change some code in future then it could easily change , As if i have to change my HTML code then it should be easily change, PHP and HTML should be placed on different files. Is there any template engine which i can use ?
Find all posts by this user
Quote this message in a reply
04-18-2009, 06:14 PM
Post: #2
RE: Can I separate PHP and HTML code
There are many template engines who separate PHP and HTML from file for easy editing in future . I Use Smarty template engine for my website . Its good and i also advise you to use Smarty , It is good tempalte engine.
Find all posts by this user
Quote this message in a reply
01-14-2010, 10:03 PM
Post: #3
RE: Can I separate PHP and HTML code
You can separate your PHP and HTML into separate files -- putting HTML files into a views or templates directory -- depending on how you want to set things up. If you do it this way, the last line of any PHP script using that template or view can just be an include statement.

Local homes for sale
Find all posts by this user
Quote this message in a reply
01-18-2010, 11:40 PM
Post: #4
RE: Can I separate PHP and HTML code
The Develop rock-solid code in PHP series is about solving practical real-life problems in medium- to large-scale applications. With a sharp focus on new features available in PHP 4, the articles shed light on numerous tips and tricks that make life easier.

Cat furniture plans
Find all posts by this user
Quote this message in a reply
02-04-2010, 01:40 PM
Post: #5
RE: Can I separate PHP and HTML code
Well You can actually incorporate the form, validation, & thank you all in one PHP file. At the top of the file, check for the existence of the required fields and, if found validate the entries. If they pass, send the e-mail and present the thank you message.

organic vegetable gardening
Find all posts by this user
Quote this message in a reply
02-10-2010, 02:04 PM
Post: #6
RE: Can I separate PHP and HTML code
Write your mainline files in php and use includes or requires to copy in other php and html code. Don't worry about some html in them if it goes with the flow.

Eileen fisher|promotional gifts|promotional plastic mugs
Find all posts by this user
Quote this message in a reply
02-27-2010, 02:54 PM
Post: #7
RE: Can I separate PHP and HTML code
If you plan on making a lot of pages with the same header, footer, nav menu and content container, then you need to make a template which you can use for every pages. Saves a lot of time.If your site allows Server Side Includes, then you can make changes to pages that have the include code.

make your own t shirt
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: