Read from textbox into array php
<p>file index.php</p>

<pre><code>&lt;html&gt;  
&lt;head&gt;
    &lt;title&gt;Guset Book&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h3&gt;Guest book&lt;/h3&gt;
    &lt;a href="/addNew.php"&gt;
        &lt;p&gt;&lt;input type="button" value="Add in book" &gt;&lt;/p&gt;
    &lt;/a&gt;
    &lt;a href="/readAll.php"&gt;
        &lt;p&gt;&lt;input type="button" value="Read all"&gt;&lt;/p&gt;
    &lt;/a&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>file addNew.php</p>

<pre><code>&lt;html&gt;  
&lt;head&gt;
    &lt;title&gt;Guset Book&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h3&gt;New&lt;/h3&gt;

    &lt;form name='formAddNew' method='post' action="ControllerAdd.php"&gt;
        &lt;p&gt;Author: &lt;input type="text" name="nameAuthor"&gt;&lt;/p&gt;
        &lt;p&gt;Comment:&lt;/p&gt;
        &lt;p&gt;&lt;textarea rows="5" cols="40" name="commentAuthor" style="resize: none;"&gt;&lt;/textarea&gt;&lt;/p&gt;  
        &lt;p&gt;&lt;input type="submit" name="submitAuthor" value="Submit"&gt;&lt;/p&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>file Model.php</p>

<pre><code>&lt;?php
class GuestBook
{
    private $author;
    private $comment;

    function __construct($author, $commment)
    {
        $this-&gt;author = $author;
        $this-&gt;comment = $commment;
    }

    public function getAuthor()
    {
        return $this-&gt;author;
    }

    public function getComment()
    {
        return $this-&gt;comment;
    }
}
$guestBookList = new ArrayObject();
$guestBookList[] = new GuestBook("Author", "Comment");

function addInList($author, $comment)
{
    $guestBookList[] = new GuestBook($author, $comment);
}
</code></pre>

<p>?></p>

<p>file ControllerAdd.php</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Add&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;?php
        require_once "Model.php";
        addInList($_POST["nameAuthor"], $_POST["commentAuthor"]);
    ?&gt;
    &lt;h3&gt;Succes&lt;/h3&gt;
    &lt;a href="/"&gt;&lt;input type="button" value="On main"&gt;&lt;/a&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>file readAll.php</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;

&lt;/head&gt;

&lt;body&gt;
    &lt;?php 
        require_once "Model.php"; 

        foreach($guestBookList as $value)
        {
            echo("&lt;br&gt;-----------&lt;br&gt;");
            echo($value-&gt;getAuthor());
            echo("&lt;br&gt;");
            echo($value-&gt;getComment());
        }
    ?&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>The problem is that complier don't throws a mistakes, but don't write the code into array from textboxes. It read in right way the info from textboxes, but don't write into array Plz help.</p>