KBL 0 Newbie Poster

Within this particular program... (yes i merged two that I had to see if I can get it work...) anyways its suppose to allow me to enter a number and then it will print out the time table for the entered number and also is to be validated so that the input is a number and less than or equal to 12... please help me out am lost !

<?php
// Logic to do the right thing based on 

// the hidden _submit_check parameter

if ($_POST['_submit_check']) {

    process_form( );

} else {

    show_form( );

}



// Do something when the form is submitted

function process_form( ) {

    print "Hello, ". $_POST['my_name'];

$numbers = range(1,12);              
$ranges = range(1,12);
foreach($ranges as $times)        
{
    echo '<tr>';
    echo "<td align=\"center\">";
        foreach ($ranges as $top)      
    {
         $output =$top * $times;      
        echo "<td style='text-align: center'>$times x $top = $output</td>";
    }
    echo '</tr>';
    echo '</tr>';
	}

}



// Display the form

function show_form( ) {

    print<<<_HTML_

<form method="POST" action="$_SERVER[PHP_SELF]">

Your name: <input type="text" name=$number>

<br/>

<input type="submit" value="Say Hello">

<input type="hidden" name="_submit_check" value="1">

</form>

_HTML_;

}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.