<html>
<head>
<title>Roll Em!</title>
</head>
<body>
<h1>Roll Em!</h1>
<?php
$roll = rand(1,6);
print "You rolled a $roll";
print "<br>";
?>
</body>
</html>
It is quite simple program, but for some reason doent work!
And it gives output like this
Roll Em!
"; ?>
The only error is the space between
<?andphp, but the full code should be:You shouldn’t use print, echo is better in nearly all cases, and you should use ” . $string . ” to paste a variable into a text string.