Hi everyone I am trying to learn PHP and general web programming on my own.
I picked up a few PHP books at the library, so far I have been doing well. I learned CSS and HTML in the past 3 months. Now I am on PHP I have one problem, I can't figure out so far. I have been going through each problem at the end of the chapters and trying to solve them on my own.
One PHP problem asks for to the user to choose sides to a dice and then generate a random roll with maximum values.
Here is what I have so far,
<html>
<head>
<title>Dice game</title>
</head>
<body>
<?php
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Enter the number of sides: <input type="text" name="sides">
<br/>
<input type="submit" name="submit" value="submit">
</form>
<?php
$roll= rand(1,6);
if (isset($POST['sides']))
{
$sides = $POST['sides'];
print rand(1,$sides);
}
?>
</body>
</html>
this is the error I get:
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\xampp\ch3num1.php on line 15
can anyone help thanks