title: Get Element By id or Name in Curl
body: <p>My target site contains code like this</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="text" name="suggest" value="www.google.com"&gt;
  &lt;input type="submit" value="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I Get this page with Curl Php</p>
  
  <pre><code>&lt;?php
  $url="http://mysite.com"; 
  $ch = curl_init(); 
  curl_setopt ($ch, CURLOPT_URL, $url); 
  $result = curl_exec ($ch); 
  echo $result;  
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>How can I get an element value using id or name? For example "www.google.com" in input name="suggest". Thanks for helping me.</p>
  
  <p>I cant use this code for remote like this :</p>
  
  <pre><code>&lt;?php
  require 'Path/QueryPath.php';
  qp('http://hipfile.com/bbgfom5ej9tm/zakhme_shaneie_haava_dvdrip.wmv.html/')-
  </code></pre>
  
  <blockquote>
    <p>find('[password="login"]')->writeHTML();
        ?></p>
  </blockquote>
  
  <p>and return this error</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'QueryPathParseException' with message 'DOMDocument::load() [domdocument.load]: AttValue: &quot; or ' expected in <a href="http://hipfile.com/bbgfom5ej9tm/zakhme_shaneie_haava_dvdrip.wmv.html/" rel="nofollow">http://hipfile.com/bbgfom5ej9tm/zakhme_shaneie_haava_dvdrip.wmv.html/</a>, line: 18 (C:\xampplite\htdocs\test1\Path\QueryPath.php: 2106)' in C:\xampplite\htdocs\test1\Path\QueryPath.php:2346 Stack trace: #0 [internal function]: QueryPathParseException::initializeFromError(2, 'DOMDocument::lo...', 'C:\xampplite\ht...', 2106, Array) #1 C:\xampplite\htdocs\test1\Path\QueryPath.php(2106): DOMDocument->load('http://hipfile....', 0) #2 C:\xampplite\htdocs\test1\Path\QueryPath.php(179): QueryPath->parseXMLFile('http://hipfile....', NULL, NULL) #3 C:\xampplite\htdocs\test1\Path\QueryPath.php(23): QueryPath->__construct('http://hipfile....', NULL, Array) #4 C:\xampplite\htdocs\test1\index.php(3): qp('http://hipfile....') #5 {main} thrown in C:\xampplite\htdocs\test1\Path\QueryPath.php on line 2346</p>
  </blockquote>
  
  <p>Can help me? I used two DOM And simplehtmldom but not working for me . it works for local page only.</p>