crap. i meant to say no php5 as well. oh well. i can do that. i guess if someone can't do php5 then tough titties. okay do you guys' posts ^ mean to serve as placeholders or what?
nevermind, i will decide for you. unless your thread specificially states "placeholder/whatever" then it doesn't count as a placeholder.
okay i just added something quick cuz i have to go soon:
<?php
$relatives = array('mother', 'father', 'sister', 'brother','uncle', 'auntie');
$verbs = array('dislikes', 'sits on', 'licks', 'sucks', 'looks like', 'does', 'discusses the pros and cons of Web 2.0', 'loves', 'caresses', 'slides onto', 'hates', 'kisses', 'learns PHP with', 'has an AJAX interface with');
$animals = array('dogs', 'cats', 'horses', 'birds', 'giraffes', 'elephants', 'hippos', 'hamsters', 'gerbils', 'monkeys');
function insult($secondary_person)
{
global $relatives;
global $verbs;
global $animals;
$r_size = sizeof($relatives) - 1;
$v_size = sizeof($verbs) - 1;
$a_size = sizeof($animals) - 1;
$r_rand = rand(0, $r_size);
$v_rand1 = rand(0, $v_size);
$v_rand2 = rand(0, $v_size);
$a_rand = rand(0, $a_size);
$insult = "Your {$relatives[$r_rand]} {$verbs[$v_rand1]} $secondary_person and {$verbs[$v_rand1]} {$animals[$a_rand]}";
return $insult;
}
class Greeting
{
function Greeting()
{
echo "Hello World!";
}
}
interface Actor
{
public function speak();
public function meet($person);
}
class Franky implements Actor
{
private $person;
public function meet($person){
$this->person = $person;
}
public function speak($insult_them = false){
if($this->person == null){
$greet = new Greeting();
echo '<br />';
}
else {
echo 'Hello '.$this->person.'!<br />';
if ($insult_them)
{
echo insult($this->person) . '<br />';
}
}
}
}
if ($_POST['name']) {
$h = new Franky;
$h->speak();
$h->meet($_POST['name']);
$h->speak(true);
} else {
echo <<<FORMINT
What's your best friend's name?<br/>
<form action = '{$_SERVER['PHP_SELF']}' method = 'post'>
<input type = 'text' name = 'name' size = '10'>
<input type = 'submit' value = 'submit'>
</form>
FORMINT;
}
?>