PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
<form action="" method="post"> Enter a number: <input type="text" name="number"> <input type="submit" value="Submit"> </form> <?php function multiplicationTable($number, $limit = 10) { echo "Multiplication Table of $number:<br>"; for ($i = 1; $i<= $limit; $i++) { echo "$number x $i = " . ($number * $i) . "<br>"; } } if ($_SERVER["REQUEST_METHOD"] == "POST") { $input = trim($_POST["number"]); if (is_numeric($input)) { multiplicationTable($input); } else { echo "Invalid input. Please enter a number.<br>"; } } ?>
Copy Clear
Copy Format Clear
<?php <form action="" method="post"> Enter a number: <input type="text" name="number"> <input type="submit" value="Submit"> </form> function multiplicationTable($number, $limit = 10) { echo "Multiplication Table of $number:<br>"; for ($i = 1; $i<= $limit; $i++) { echo "$number x $i = " . ($number * $i) . "<br>"; } } if ($_SERVER["REQUEST_METHOD"] == "POST") { $input = trim($_POST["number"]); if (is_numeric($input)) { multiplicationTable($input); } else { echo "Invalid input. Please enter a number.<br>"; } } ?>
Show:  
Copy Clear