this particular php script page does not actually connect to a database. Everything is self-contained within the html page, so it shouldn't actually be trying to connect to anything,
I assume that if php is installed properly, it should work?
here is the script:<html>
<head>
<title>phpMagic8</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
Ask the magic 8-ball a question!
<br>
<form method="post" action='<? echo $PHP_SELF; ?>'>
<input type="text" name="question" value="<? echo $question; ?>">
<br>
<input type="submit" value="Tell me, o wise one"></form><br>
<?
if (isset($question)) {
$answers = array( "Yes",
"No",
"Of Course",
"Never",
"Maybe",
"Theres a Chance",
"What do you think I am, psychic?",
"Sometimes",
"If you're lucky");
srand((double) microtime() * 1000000);
$count = count($answers);
echo "The wise 8-ball says... " . $answers[rand(0,$count)];
}
?>
</body>
</html>
|