You must specify the number of rows and columns.

"; } else { echo "

A $cols x $rows Grid

"; echo "\n"; for($r = 1; $r <= $rows; ++$r) { echo ""; for($c = 1; $c <= $cols; ++$c) echo ""; echo "\n"; } echo "
", "
"; } ?>