Saturday, May 19, 2012

ITC280 Update 7

What I learned on Week 7:


1) Keeps PHP from send the page before we are ready
ob_start();

2) Here we strip out the identity of the current page
define('THIS_PAGE',basename($_SERVER['PHP_SELF']));


3) There are 4 variations on include;
include()


include_once()


require()


require_once()




include creates an error but it’s catchable...


require will cause a page crash if not found


_once() makes sure a file is not loaded with


4) we can reference any other include files here
include 'credentials.php';


5) We can place all of our links in an assoc. array
$nav1 = array();


$nav1['index.php'] = "Home Page";


$nav1['email8.php'] = "Contact Us!";


$nav1['kittens1.php'] = "Kittens!";


$nav1['links.php'] = "Our Favorite Links!";



6. //this guarantees a unique title tag
$titleTag = THIS_PAGE;


7. Replace the title tag with our variable
<title><?=titleTag;?></title>


NOTES:

Well, luckily, there will be no test this weekend but I still can't think what will my final project will be. It's still to early to tell because we are still tackling more lessons and currently, we're in the process of Assignment 8 which is Themes/Functional Includes. We began since Wednesday but actually, this is too long to finish. Happily, there's still more to learn this Monday and the deadline for Assignment 8 will be Wednesday, May 23rd.

That is all...

No comments: