I am making a php script that obtains a number limit from the user through html when the user clicks on the submit button it takes them to a php page that displays all numbers from 1 up to the number limit that the user chose and it will display odd or even next to each appropriate number. So if the user types in 4 it should display like this on the php page, 1 odd 2 even 3 odd 4 even I have already created the html part i just need help with the php, how would i go about doing this? Thanks.
say your number from get or post is $num = $_GET['num']; // or $_POST['num'] for($i = 1; $i <= $num; $i++) { echo $i, ' ', ($i%2==0 ? 'even' : 'odd'), "\n"; } PHP: