Hi,
This code should work now:
<?php
class quotes
{
function quotes() {
switch(intval(rand(1,6)))
{
case 1:
$this->quote = "Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming - WOW - What a Ride! /n -Anon" ;
break;
case 2:
$this->quote = "It was when I found out I could make mistakes that I knew I was on to something. /n -Ornette Coleman" ;
break;
case 3:
$this->quote = "You can't build a reputation on what you're going to do /n -Henry Ford";
break;
case 4:
$this->quote = "People are just as happy as they make up their minds to be /n -Abraham Linkcoln";
break;
case 5:
$this->quote = "Good advice is something a man gives when he is too old to set a bad example /n -Francois de La Rochefoucauld ";
break;
case 6:
$this->quote = "I wish I owned this site";
break;
}
}
}
$quotes = new quotes();
echo $quotes->quote;
?>
quotes - is a class name. We assign a random quote to the $quote member of this class in its constructor.
Than we create an instance of this class in the variable $quotes. And then print its $quote member.