now I am thouroughly confused. Here is the script...
Code: Select all
<html><head>
<title>Basic Texas Hold 'em game</title>
<link rel="stylesheet" href="style.css" media="screen" />
</head>
<body>
<div id="header">
<h1 style="color: #00ff00";>TEXAS HOLD 'EM</h1><br />
<p>pathetic and basic, but hopefully it works, good luck and have fun</p>
</div>
<div id="mycards">
<h3><center>Your Cards</canter></h3>
<?php
$n = 2;
$c = 1;
$suits = range(1, 4);
$random = array_rand($suits, $c);
foreach($random as $numbers)
{
switch($numbers)
{
case 1:
$finalsuit = "Diamonds";
break;
case 2:
$finalsuit = "Hearts";
break;
case 3:
$finalsuit = "Clubs";
break;
case 4:
$finalsuit = "Spades";
break;
default:
$finalsuit = "none";
break;
}
}
$data = range(1, 14);
$rand = array_rand($data, $n);
foreach($rand as $number)
{
switch($number)
{
case 11:
echo 'Jack of ' . $finalsuit . '<br />';
break;
case 12:
echo 'Queen of ' . $finalsuit . '<br />';
break;
case 13:
echo 'King of ' . $finalsuit . '<br />';
break;
case 14:
echo 'Ace of ' . $finalsuit . '<br />';
break;
default:
echo $number . ' of ' . $finalsuit . '<br />';
break;
}
}
?>
I get these errors when I run it...
Warning: main() [function.main]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-8.0/no DST' instead in C:\WEB_ROOT\randomnumbertest2.php on line 18
Warning: Invalid argument supplied for foreach() in C:\WEB_ROOT\randomnumbertest2.php on line 18
Warning: main() [function.main]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-8.0/no DST' instead in C:\WEB_ROOT\randomnumbertest2.php on line 60
Notice: Undefined variable: finalsuit in C:\WEB_ROOT\randomnumbertest2.php on line 60
5 of
Warning: main() [function.main]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-8.0/no DST' instead in C:\WEB_ROOT\randomnumbertest2.php on line 60
Notice: Undefined variable: finalsuit in C:\WEB_ROOT\randomnumbertest2.php on line 60
8 of
That is the output on the page when I run that script. I am so freaking lost now, it makes no sense at all. Please help.
