Help me find what mistake i ve made...

[php]

multiplication tables <?php if(isset($_post['submit1'])) { $start=$_post['start']; $final=$_post['final']; $m=$_post['multiplier']; for($start;$start<=$final;$start++) { $ans=$start*$m; print $start. "*" . $m . " = ". $ans . "
"; } } ?> STARTING NUMBER:

FINAL NUMBER:

ENTER MULTIPLIER:

[/php]

I ve written this code to print multiplication tables…But nothing gets printed…I want to figure out what mistake i ve made…Kindly help

If that page isn’t called tables.php, then that’s why its not printing. You have some page called tables.php in the form action.

I’ve named the php code file tables.php. I’ve also used tables.php in the action attribute to make the script return vales to the same form. Can’t that be done?

Its not needed. one other thing that i see is this - $_post, it should be $_POST, all in caps.

Thank you loads!!! :smiley:
I changed ‘post’ to caps and the script worked fine!!

Sponsor our Newsletter | Privacy Policy | Terms of Service