编写一个程序,让用户选择骰子的数量 拥有并打印一个具有适当最大值的随机卷 值。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NumberOfFace</title>
</head>
<body>
<?php
print <<<HERE
<h3>How many Face you want for your Dice</h3>
<form action="" method="post">
<input type="text" name="numFace" value="$numFace"/>
<input type="submit" >
HERE;
$roll=rand(1,$numFace=filter_input(INPUT_POST, "numFace"));
print<<<HERE
<p>you rolled a $roll.</p>
<p>
<img src="die$roll.png"
alt=die="die: $roll"/>
</p>
HERE;
?>
</body>
</html>
我收到此警告:rand()期望参数2为long,第21行的C:\ xampp \ htdocs \ numFaces.php中给出字符串