php - Query data using curl -


Why this code is not working, why - I do not understand. The code gets a response from the curl (to see) in this answer, yes, if it is found - which displays the text - if not, the second code:

  & Lt ;? Php / curl $ ch = curl_init ('http: //dev.local/phpwhois-4.2.2/example.php? Query = domain.ru & product = item'); Curl_setopt ($ CH, CURLOPT_USERAGENT, "Mozilla / 5.0"); Curl_setopt ($ CH, CURLOPT_HEADER, incorrect); $ Curl = curl_exec ($ ch); Echo $ curl; Curl_close ($ ch); If (preg_match ('~ \ s * yes \ s * ~ u', $ curl) 'echo'; Else echo 'other lesson'; ? & Gt; Strange error, more accurate, this is not at all, but - if curl sends text Yes, that does not work, he writes, and if he does not give the lesson - Also other. If all the text which is only kept in the variable that curls itself, then it works.  

This is what gives curl to 'e (written in writing, what else is there to write this answer):

regrinfo-> array disclaimer-> array 0-> By submitting a query, RIPN's Vice Service 1-> you agree to follow the following terms of use: 2 -> # 3.2 (in Russian) 3- # 3.2 (in English) Domain-> Array's name -> Hashod.ru NSR-> ARR NS1 Namsialfi-> 81.176.95.18 ns2. Namself.com-> 88.212.207.45 Status-> Registered, Deleted, Created Verified-> ends 2010-11-05-> 2014-11-05 Source-> TCI Registered-> Yes Regyinfo-> Array Referrer-> Registrar-> Russent -REG-RIPN Server-> Array-> Array Server-> RU.whois-server.net args-> Hashod- R- Port-> 43 Type-> Domain- rawData-> Array 0 ->% By submitting a question for RIPN's Vice Service 1 ->% you agree to follow the following terms of use Are: 2 ->% (in Russian) 3 ->% (in English) 4-> 5-> Domain: 6-> NSC. 7-> Server: 8-> State: Registered, Suspended, Verified 9-> Person: Private person 10-> Registrar: REGTEM-REEG-RIPN 11-> Admin-contact: 12-> Created: 2010.11.05 13- > Payments: 2014.11 .05 14-> Free-Date: 2014.12.06 15-> Source: TCI 16-> 17-> Last Update 2014.07.27 12:31:31 MSK 18 ->

you flag back transfer

  & lt ; PHP / curl $ ch = curl_init ('http: //dev.local/phpwhois-4.2.2/example.php? Query = domain.ru and output = object'); Curl_setopt ($ CH, CURLOPT_USERAGENT, "Mozilla / 5.0"); Curl_setopt ($ CH, CURLOPT_HEADER, incorrect); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); $ Curl = curl_exec ($ ch); Echo $ curl; Curl_close ($ ch); If (preg_match ('~ \ s * yes \ s * ~ u', $ curl) 'echo'; Else echo 'other lesson'; ? & Gt;  

Also keep in mind about timeouts in the future. Good luck.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -