Section A.16. Chapter 16


A.16. Chapter 16


Solution to Question 16-1

To change the blog name to "PHP and MySQL Zone," modify the config.php as follows:

 <?php   // put full path to Smarty.class.php   require('/usr/share/php/Smarty/Smarty.class.php');   $smarty = new Smarty();   $smarty->template_dir = '/home/www/htmlkb/smarty/templates';   $smarty->compile_dir = '/home/www/htmlkb/smarty/templates_c';   $smarty->cache_dir = '/home/www/htmlkb/smarty/cache';   $smarty->config_dir = '/home/www/htmlkb/smarty/configs';   $blog_title="PHP and MySQL Zone"; ?> 


Solution to Question 16-2

From the MySQL client, execute the SQL query:

 insert into categories values (NULL, 'Bugs'); 

You can also add the row using phpMyAdmin. Because the drop-down category list is created dynamically, this is the only change required to add a new category.


Solution to Question 16-3

Templates make it easy to keep your site organized. Changes made to the header and footer automatically apply to all pages. Also, editing the HTML is easier because there isn't any PHP code mixed in with it.



Learning PHP and MySQL
Learning PHP and MySQL
ISBN: 0596101104
EAN: 2147483647
Year: N/A
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net