best method to make a template?
Posted: Sun Apr 10, 2011 2:18 am
hello i am new to php.
i started learning PHP 2 days a go ( i came from c++ ).
using the book "build your own database driven website using php & mysql 4th edition"
in this book the author showed his method to a template.
he showed this through an example of a connection to mysql and outputting a string if the connection fails or succeeds
1. index.php
had the connection form
and he assigned the string to an output variable.
2.output.htm.php
had the template (html page)
and had an
my question is whats the difference and wich method is better his method
or just 2 pages one is index.php which have an include statement to connection.php and a connection.php page which have the connection script?
thanks in advance...
i started learning PHP 2 days a go ( i came from c++ ).
using the book "build your own database driven website using php & mysql 4th edition"
in this book the author showed his method to a template.
he showed this through an example of a connection to mysql and outputting a string if the connection fails or succeeds
1. index.php
had the connection form
and he assigned the string to an output variable.
2.output.htm.php
had the template (html page)
and had an
Code: Select all
<?php
echo $output
?>
or just 2 pages one is index.php which have an include statement to connection.php and a connection.php page which have the connection script?
thanks in advance...