title: php, curl, curl_exec()
body: <p>i'm stuck to try handle a random name and value of form html to post data through curl.<br>
  here my code.</p>
  
  <pre><code>function grapvalue($html){
  
  //parse content to grap name and value random
  
  }
  
  $opt = array(
           CURLOPT_AUTOREFERER =&gt; true,
           CURLOPT_RETURNTRANSFER =&gt; true,
           CURLOPT_COOKIEFILE =&gt; 'cookie.txt',
           CURLOPT_COOKIEJAR =&gt; 'cookie.txt'
           CURLOPT_POST =&gt; true,
           CURLOPT_POSTFIELDS =&gt; grapvalue($html)
         )
  
  $init = curl_init("site.com")
  curl_setopt_array($init,$opt)
  $html = curl_exec($init)
  </code></pre>
  
  <p>I have to execute the function curl_exec () twice, first I have to execute the curl_exec function to retrieve the html to get the names and random values​​, then send the data.
  how do I resolve this?</p>