title: DOM getElementbyId doesn't work properly
body: <p>I have a little problem with extracting value of input from an HTML form. As I know, there is nothing wrong with my code, but I cannot find what's the problem.</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL );
      ini_set('display_errors', 1);
  
  $t =&lt;&lt;&lt;D
  &lt;form id="frm-send" method="post"   action="index.php"   &gt;
  &lt;input type="text" name="data[postusername]" id="postusername" value="user"  /&gt;    
  &lt;input type="checkbox"  name="data[save]" id="data[save]" value="1" /&gt;   
  &lt;input type="hidden" name="secret" id="secret" value="0d35635c0cb11760789de6c4fe35e046311f724b" /&gt;
  &lt;input type="submit" name="btnSubmit" id="btnSubmit" value="Send"  /&gt;   
  &lt;input type="hidden" name="data[checkgetrequest]" value="true" id="data[checkgetrequest]" /&gt;
  &lt;input type="hidden" name="frm-id" value="13448477965028bfb44222d" id="frm-id" /&gt;
  &lt;/form&gt;
  &lt;input type="text" id="getfocus_txt_13448477965028bfb44222d" name="getfocus_txt_13448477965028bfb44222d" /&gt;
  
  
  D;
      $dom = new domDocument;
      $dom-&gt;loadHTML($t);
      $dom-&gt;preserveWhiteSpace = true;
      $frmid = $dom-&gt;getElementById('frm-id') ;
      echo  $frmid-&gt;getAttribute('value');
  
  
  ?&gt;
  </code></pre>
  
  <p>It shows me an error:</p>
  
  <pre><code>Fatal error: Call to a member function getAttribute() on a 
  non-object in E:\Apache\msg.php on line 22
  </code></pre>
  
  <p>I'm using XAMPP 1.7.3 on windows 7 .
  I tested it on my server and it showed me no errors.
  Any help would be appreciated. </p>