Retrieving data using PHP cURL while logged in -


i complete n00b @ using curl , trying simple retrieval using $_post. think problem may url using, https. have suggestion on how can handle this.

here code: formy.php

 <pre> <form name="test" method="post" action="formy.php"> <input  type="text" name="name" size="40" />  <input type="submit"  name="submit" value="submit" />  </form> </pre> 

curl.php

$h = curl_init();  curl_setopt($h, curlopt_url, "https://path/to/formy.php";  curl_setopt($h, curlopt_post, true); curl_setopt($h, curlopt_postfields, array( 'name' => 'yes', 'submit' => 'submit' )); curl_setopt($h, curlopt_header, false); curl_setopt($h, curlopt_returntransfer, 1);  $result = curl_exec($h); echo "test" . $result; 

just add following option before curl_exec

curl_setopt($h, curlopt_ssl_verifypeer, false); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -