Jump to content

Archived

This topic is now archived and is closed to further replies.

Chevy

Stuck..

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.