request URL with parameters in curl php -
i want request web page content particular option selected drop down list.
in example, want content web page community , level 2 drop down lists. , want web page option community='softwarefactory/cloude'
, level='v6r2015x'
.
my code
<?php // init resource $ch = curl_init('http://e4allds/'); // set single option... $postdata = array( 'community' => 'softwarefactory/cloud', 'level' => 'v6r2015x' ); curl_setopt_array( $ch, array( curlopt_url => 'http://e4allds/', curlopt_postfields => $postdata, //option1=> 'community=softwarefactory/cloud', //option2=> 'level=v6r2015x', curlopt_returntransfer => true )); $output = curl_exec($ch); echo $output;
but giving result default selection. please me how can pass these parameters url?
you need enable curl
post parameter true
.
curl_setopt_array( $ch, array( curlopt_post => true, //<------------ 1 ! curlopt_url => 'http://e4allds/', curlopt_postfields => $postdata, //option1=> 'community=softwarefactory/cloud', //option2=> 'level=v6r2015x', curlopt_returntransfer => true ));
Comments
Post a Comment