PHP - cURL. Error 501 Not Implemented -
i getting error upon submitting post request using curl. far have code:
$login_url = 'http://192.168.1.1/login'; $postarr = array( 'username'=>'username', 'password'=>'password', 'dst' => base_url().'login/home' ); $this->curlpost($login_url, $postarr); function curlpost($url, $data){ $ch = curl_init(); curl_setopt($ch, curlopt_url,$url); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_postfields, http_build_query($data)); curl_setopt($ch, curlopt_httpheader, array("content-type: application/x-www-form-urlencoded")); curl_setopt($ch, curlopt_returntransfer, true); $server_output = curl_exec ($ch); curl_close ($ch); echo 'using curl --- '.$url.'<br />'; var_dump($server_output); }
basically, code should post username , password specific url, unfortunately returning "error 501: not implemented" server wamp. have idea causing issue? thanks
Comments
Post a Comment