>Center HTML/Webpage

>To center your webpage its simple. By setting the width and margin you can achieve this. However, depending on the browser (Internet Explorer) you must include the doctype or it will not work. See the code below

<!DOCTYPE html>
<html>
<body>
<head>
<style>
    #main { 
	    width: 900px; 
        margin: 0 auto; 
    }
</style>
</head>
<body>
    <div id="main">
    </div>
</body>
</html>

resource:
http://www.tipue.com/blog/center-a-div/

>Quote: Stick to it

>Steve Jobs stepped down as CEO at Apple today. He is an inspiration to me and many others through his products, life and beliefs.

The problem with the Internet startup craze isn’t that too many people are starting companies; it’s that too many people aren’t sticking with it. That’s somewhat understandable, because there are many moments that are filled with despair and agony, when you have to fire people and cancel things and deal with very difficult situations. That’s when you find out who you are and what your values are.

So when these people sell out, even though they get fabulously rich, they’re gypping themselves out of one of the potentially most rewarding experiences of their unfolding lives. Without it, they may never know their values or how to keep their newfound wealth in perspective. -Steve Jobs

>Giveaway

>This is baligena first Giveaway. What better way to thank all you who been supporting the site. baligena will be giving an iPod shuffle. The giveaway starts today and ends on September 3rd 2011.

Now here is how to win

1. First you must subscribe to my feed by putting your email under “Follow by Email” on the left sidebar and click submit.

2. Leave a comment on any of my post saying “This is the first comment”.

>Principle of Least Privilege

>The principle of least privilege can be used to improve the security of any computer system. It’s a basic but important principle that is often overlooked. The principle is as follows:

A user (or process) should have the lowest level of privilege required to perform his assigned task.

It applies in MySQL as it does elsewhere. For example, to run queries from the Web, a user does not need all the privileges to which “root” has access. You should therefore create another user who has only the necessary privileges to access the database you just created.

Excerpt from PHP and MySQL Web Development page 223

>Quote: The climb is the best part

>”To climb up the mountain is the best thing. you know preparing for it. Living every day in practice, working hard, talking about it, seeing the commitment out of the kids, everybody on the team is at practice, 100 percent all the time and just working hard every day. That’s where the comradely happens that’s where you bond and hopefully when you get the chance you’ll be able to do it” -Russ Cozart Brandon High School Wrestling Coach

Cozart makes this statement in an interview about the next chance he gets at the National High School Dual Meet Wrestling Tournament after lost in the finals.

Watch the interview

>Youtube Data API

>Below is a PHP script that uses Youtube API through xml to show the comments on your personal website.

I didn’t include any CSS.

Use this link a reference

http://code.google.com/intl/it-IT/apis/youtube/2.0/developers_guide_protocol.html

<?php

//// video id
$videoId='M1Wm9nGJcYo';

//echo the video
echo "";

// url where feed is located
$url="http://gdata.youtube.com/feeds/api/videos/$videoId/comments";

// get the feed
$comments=simplexml_load_file($url);

// parse the feed using a loop
foreach($comments->entry as $comment)
{
echo '
'. $comment->content .'
'. $comment->author->name .'
';
}



?>

>.inc vs .php file extention

>

.inc stands for include.

Some may prefer to name their file page.inc when using the php function include() because it looks prettier.
include(‘page.inc’);
page.inc or page.php both work the same way.

I would stick with the .php extension instead of the .inc extension because the difference is that the .inc is easier to identify when navigating through files in website directory. It has security issues because if positioned in the wrong directory it will not be parse as php by your host if opened directly, making you code readable. But when you have a .php extension php is parsed and the code is not shown to the outside.