Chevy Posted August 13, 2006 Share Posted August 13, 2006 I am making a game and I only want 4 things displayed on 1 line My Code Now:[code]<?php$frogs = 1;$level = 8;echo "<h3>Level $level</h3>";echo '<table border="0" align="center"><tr>';while ($frogs <= $level) {echo "<td>";echo '<form action="" method="POST">';echo 'Frog ';echo "$frogs";echo '<br><input type="submit" name=';echo "\"$frogs\"";echo ' value="Choose This Frog!"></td>';$frogs = $frogs + 1;}echo "</tr></table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/17403-stuck/ Share on other sites More sharing options...
redarrow Posted August 13, 2006 Share Posted August 13, 2006 there you go four frogs on one link ok.[code]<?php$frogs = 1;$level = 4;echo "<h3>Level $level</h3>";echo '<table border="0" align="center"><tr>';while ($frogs <= $level) {echo "<td>";echo '<form action="" method="POST">';echo 'Frog ';echo "$frogs";echo '<br><input type="submit" name=';echo "\"$frogs\"";echo ' value="Choose This Frog!"></td>';$frogs = $frogs + 1;}echo "</tr></table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/17403-stuck/#findComment-74056 Share on other sites More sharing options...
Chevy Posted August 13, 2006 Author Share Posted August 13, 2006 Haha, I know that...What if I had 10 there? I want it to make a new line or <tr> every multiple of four like so: 1 2 3 4 5 6 7 8 9 10 11 12 Link to comment https://forums.phpfreaks.com/topic/17403-stuck/#findComment-74061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.