What do you think about this?
<?php
$yourrace = array ("Half-Orc" , "Halfling" , "Gnome" , "Dwarf" , "Half-Elf" , "Elf" , "Human");
$yourrace = rand($yourrace);
$yourclass = array ("Assassin" , "Barbarian" , "Bard" , "Cleric" , "Druid" , "Fighter" , "Illusionist" , "Monk" , "Paladin" , "Ranger" , "Rogue" , "Sorcerer" , "Theif",
"Wizard");
$yourclass = rand($yourclass);
$yourweapon = array ("knife" , "club" , "dagger" , "bow" , "sword" , "gun" , "catapult");
$yourweapon = rand($yourweapon);
$yourstrength = rand(5,12);
if ($yourstrength == "5" || $yourstrength == "6" || $yourstrength == "7"){
$strengthword = "Weak";
} elseif ($yourstrength == "8") || $yourstrength == "9" || $yourstrength == "10"){
$strengthword = "Tough";
} elseif ($yourstrength == "11"){
$strengthword = "Strong!";
} elseif ($yourstrength == "12"){
$strengthword = "Super Strong!!!";
}
$yourdefense = rand(5,12);
if ($yourdefense == "5" || $yourdefense == "6" || $yourdefense == "7"){
$defenseword = "Weak";
} elseif ($yourdefense == "8") || $yourdefense == "9" || $yourdefense == "10"){
$defenseword = "Tough";
} elseif ($yourdefense == "11"){
$defenseword = "Strong!";
} elseif ($yourdefense == "12"){
$defenseword = "Super Strong!!!";
}
$bodymess = " <center>\n
<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n
Your name: <input name=\"p1\">\n
<br>\n
<input type=\"submit\" value=\"Play!\">\n
</form>\n
</center>
";
echo $bodymess;
if (isset($_POST['p1'])){
$p1 = $_POST['p1'];
$bodymess = "
<hr width=\"100%\"><table width=\"30%\">
<b>".$p1."</b><br>Race: ".$yourrace."<br>Class: ".$yourclass."<br>Weapon: ".yourweapon."<br>Strength: <b>".$strengthword."</b>(<b>".$yourstrength."</b>/12)<br>Defense: <b>".$defenseword."</b>(<b>".$yourdefense."</b>/12)
</table></hr>
";
} else {
echo "<br><center><font color=\"red\">You forgot to enter your name</font></center>";
}
?>
It would show something like this:
Kylesite
Race: Human
Class: Assassin
Weapon: gun
Strength: Strong
Defense: Weak/B