First; I'm working on setting up a PhP program that allows the user to choose (using a checkbox), how many sides are on a die. Following this, there would be a "rand" for that, all on the same document. The following is my current progress:
Code:
<html>
<head>
<title>Checkbox Demo</title>
</head>
<body>
<?
print <<<HERE
chk4S: "$4S" <br>
chk6S: "$6S" <br>
<hr>
HERE;
if (!empty($4roll))
{
$4roll = rand(1,4);
print "You rolled a $4roll";
print "<br>";
} //end if
if (!empty($6roll))
{
$6roll = rand(1,6);
print "You rolled a $6roll";
print "<br>";
} //end if
?>
<h1>Checkbox Demo</h1>
<h3>Demonstrates checkboxes</h3>
<h3>Please input the amount of sides of the die.</h3>
<form action ="<? php echo $_SERVER['PHP_SELF']; ?>">
<ul>
<li> <input type = "checkbox"
name = "4roll"
> 4-Sided Die
</li>
<li> <input type = "checkbox"
name = "6roll"
> 6-Sided Die
</li>
</ul>
<input type = "submit">
</form>
</body>
</html>
However I get the following error:
"Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/rbthrdso/public_html/chapter4/index.php on line 21"Anyone capable of assisting would be greatly appreciated.
And second. I'm also working on getting a program (in PhP), that can allow a user to pick and choose what options (IE: Font color, background color, etc) go into the generated HTML page.
Please and Thank You 
Last edited by MGT-Evelath; 09-24-2007 at 02:04 PM..
|