I was trying to write a code for fizz buzz game...and i completed it...but the problem is i need to take input from the user, my code only works for the input that i have declared inside the code...could anyone specify any way that i can take input from user...post method didn't work.. my code is as follows...
<html>
<body>
<form method="post">
enter Value of A
<input type="text" name="A">
enter value of B
<input type="text" name="B">
enter value of N
<input value="text" name="N">
</form>
</body>
</html>
<?php
$N=$_POST["N"];
$A=$_POST["A"];
$B=$_POST["B"];
while($N!=100) {
if($N%$A==0 & $N%$B==0) {
echo"FizzBuzz\n";
}
elseif ($N%$A==0) {
echo"Fizz\n";
}
elseif ($N%$B==0) {
echo"buzz\n";
}
else
echo"$N \n";
$N=$N+1;
}
?>