I am a PHP beginner and I am stuck on an assignment for school. I have to create 6 different drop down menus (num1 , num2 , num3 , num4 , rows , columns) each with the numbers 1 through 10 in it. I then have make sure the form is submitted, and only when it is submitted all perfectly, then I have to use the variables to create a table based on even and odd numbers.
<form method="post" action="prelab2.php">
<select name="num1">
<option>Pick one</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
Above is the drop-down menu, now this is where I am really stuck.
<?php
$_POST['submit'];
$num_1=$_POST['num1'];
$num_2=$_POST['num2'];
$num_3=$_POST['num3'];
$num_4=$_POST['num4'];
$rows=$_POST['rows'];
$cols=$_POST['cols'];
?>
I figured out how to $_POST the variables, but how can I take these variables (only on submit) and turn it into a table?