I love my brother, because he's half jerk, half awesome.

Recent updates

The “I Love” Project

Every year since 2010 I celebrate my domain's birthday on the 11th October with some kind of project. In 2010, it was the 'Love is...' Project and you submitted your definitions of love. In 2011, you shared what it is that you love.

On the 9th October 2011, this design was released with a rotation above the sidebar with chosen submissions. Read more...

Further links

PHP: Random Quote

If you’re looking for a simple “random quote” to add on your site, this is for you. You will need to be able to use PHP on your website and have pages with a .php extension, so make sure of that first.

Note: If you want a random button rotation, visit my other tutorial instead.

Example

Random quote: The journey of a thousand miles starts from beneath your feet.

Refresh the page to see the code in action.

The code

Paste the following code into a fresh, new document.

<?php

$quotes[] = "Quote here";
$quotes[] = "Quote here";
$quotes[] = "Quote here";
$quotes[] = "Quote here";
$quotes[] = "Quote here";
$quotes[] = "Quote here";

srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);

echo " " . $quotes[$randomquote] . " ";

?> 

Save the document as quotes.php.

Editing the code

Replace Quote here with your quote. You can use HTML such to make part of the font bold or use a line break to make a new line.

If you want more quotes, copy the line $quotes[] = "Quote here";.

If you want less quotes, simply delete one of the lines.

Note: If you would like to use double quotes () within your quotes, place a backslash (\) before it. For example:

$quotes[] = "Jim said, \"Gosh you are right!\"";

Or you can just use single quotes.

Putting it on your page

Find the page where you want the random quote to appear.

Simply paste this PHP include:

<?php include('quotes.php'); ?>

Upload both files to your website and it should work.