How can i generate a square from user input that outputs letters or numbers
<p>How do I use .php to generate a square or rectangle that is created using a letter  or number based on how many rows/columns a user enters? Here is a sample of what I am looking for. I've done this with javascript but wanted to learn some server side scripting (.php). Started a couple weeks ago so forgive my novice errors.</p>

<pre><code>FFFFF
FFFFF
FFFFF
FFFFF
FFFFF
</code></pre>

<p>Here is what I have so far:</p>

<pre><code>&lt;?php
#initial page load
#create functions and call them in program
#create variables
#get user input
$row = filter_input(INPUT_GET, "row", FILTER_VALIDATE_INT);
$col = filter_input(INPUT_GET, "col", FILTER_VALIDATE_INT);

#for loop to generate rectangle or square of "F" or "5"
function forTangle() {
    $theader = '&lt;table border = "0"&gt;';
    $tbody = ' ';
    $sum = 0;
    $tfooter = ' ';
    $output = "Nested For Loop";
    for ($i = 0; $i &lt; $row; $i++) {
        $tbody += '&lt;tr&gt;';
        for($j = 1; $j &lt; $col; $j++) {
            $sum = $i + $j;
            $tbody += '&lt;td&gt;';
            $tbody += "$i + $j + = $sum";
            $tbody += '&lt;/td&gt;';
        }
        $tbody += '&lt;/tr&gt;'; 
    }
        $tfooter = '&lt;/table&gt;';
        echo $output;
        #Variable that outputs the table of "F" or "5"???
        #how do i call the DOM and put this in a container? 

}
?&gt;

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;link rel="stylesheet" type="text/css" href="q3.css"&gt;
&lt;title&gt;Allen Ricardo's Magic Rectangle&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class="header"&gt;
&lt;header&gt;&lt;h1&gt;Rectangle&lt;/h1&gt;&lt;/header&gt;
&lt;/div&gt;
&lt;div class="prompt"&gt;
&lt;h3&gt;Rectangle&lt;/h3&gt;
&lt;br&gt;
&lt;h3&gt;&lt;?php "rectangle has ${row}s, and ${col}s."; ?&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div class="output"&gt;
&lt;p&gt;&lt;?php echo forTangle(); ?&gt;&lt;/p&gt; 

&lt;!--container for rectangles--&gt;


&lt;/div&gt;

&lt;div class="link"&gt;
&lt;a href="q3_index.html"&gt;Back to Homepage&lt;/a&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

********************************************
</code></pre>

<p>This is how I solved this a different way using js.</p>

<pre><code>function forTangle() {
var num_rows = document.getElementById('rows').value;
var num_cols = document.getElementById('cols').value;
var theader = '&lt;table border="0"&gt;\n';
var tbody = '';
var sum = 0;
var i;
var j;

    for(i=1; i&lt;=num_rows;i++)
        {   
            tbody += '&lt;tr&gt;';
            for(j=1; j&lt;=num_cols;j++)
        {
                sum = i + j; &lt;!--sum of row + column number--&gt;
                tbody += '&lt;td&gt;';
                tbody += (i + "+" + j + "=" + sum); &lt;!--values in the table cell--&gt;
                tbody += '&lt;/td&gt;';
        }
                tbody += '&lt;/tr&gt;\n';
    }
            var tfooter = '&lt;/table&gt;';
            document.getElementById("output3").innerHTML ="Nested for loop rectangle" + "&lt;br&gt;" + theader + tbody + tfooter; &lt;!--output to screen--&gt;
}
</code></pre>