I have two files that send a curl post and the one who gets the post runs a query. The problem even if print_r shows 'The' if '' statement still fails. What am I missing? Any help would be awesome. The cause of CURLOPT_RETURNTRANSFER returns curl_exec () either false or string. So the question is whether it is an array or not, it can not be, because it is a string, therefore, you need it somewhere else rather than Newline or White space. $ curl = curl_init (); Curl_setopt ($ curl, CURLOPT_URL, "http: //url/filename.php"); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, FALSE); Curl_setopt ($ curl, CURLOPT_POST, true); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYHOST, incorrect); Curl_setopt ($ curl, CURLOPT_POSTFIELDS, "col1 = data and col2 = moredata"); $ CurlResult = curl_exec ($ curl); Curl_close ($ curl); Print_r ($ Curls Result); If ($ curlResult == "accepted") {echo 'right'; } And {echo 'wrong'; }
Comments
Post a Comment