0

Basically I want to create dynamic table in php so i created two pages. The first one I named "index.php" and the second one "table.php"(where the table will output after submiting).

1- First Page Code (index.php):-

<form method="POST" action="table.php">
    Table: <input type="text" name="table"> 
    Start Num: <input type="text" name="start"> 
    End Num: <input type="text" name="end"> 
    <input type="submit" value="Submit">
</form>

2- Second Page Code (table.php)

<?php 

$table = $_POST['table'];
$start = $_POST['start'];
$end = $_POST['end'];

if (isset($_POST['submit'])) {
    for($i=$start; $i<=$end; $i++) {
        echo $table . ' x ' . $i . ' = ' . $table * $i . '<br>';
    }
}

?>

This is my second page code, but unfortunately I'm not getting output , I'm getting blank page when i type the inptut fields and submited the button so pls have a look at my code.Thank You

0 Answers0