Objective: User gets a new message every time; he refreshes the page.
Requirements: Adobe Dreamweaver or any Open Source Editor like Amaya, Aptana Studio etc.
Code:
<?php
$thoughts = “WORK IS WORSHIP
AS YOU SOW, SO YOU REAP
BARKING DOG SELDOM BITE
KNOWLEDGE IS POWER
SHOOT FOR THE MOON, YOU WILL REACH THE STARS
AN APPLE A DAY KEEPS THE DOCTOR AWAY
I AM WHAT, I AM
TO ERR IS HUMAN, TO FORGIVE IS DIVINE
WHEN THE NIGHT IS DARKEST, THE DAWN IS NEAREST
THEY CONQUER WHO BELIEVE THEY CAN
NOTHING IS IMPOSSIBLE
TIME & TIDE WAITS FOR NONE
THINK BEFORE YOU LEAP”;
$thoughts = explode(“\n”, $thoughts);
$chosen = $thoughts[mt_rand(0, count($thoughts)-1)];
print $chosen;
?>
An engineer by chance and a blogger by choice. Love to share my knowledge with the masses. My main focus is always on open source technologies and latest gadgets. This blog provides me the platform to cherish my passion.
Website - More Posts