Category : curl

Is it possible to Inspect network activity with cURL? in the browser if i navigate to a specific website, it loads a lot of external resources. some of those resources are not in the body so i can’t see them in the cURL. it’s probably being generated by ajax / some .js file. i’d like ..

Read more

Hi guys I’ll explain my code: I have a telegram bot and I have to write many messages quickly in a group and to write a message it is necessary to execute a link (using the Telegram Api). To do this I use Curl: curl_setopt($ch, CURLOPT_URL, $url_telegram); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, ..

Read more

Am a new PHP codder on a share hosting services trying to connect my android http_sms_gateway app with REST API but connection always refused $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => ‘http://10.32.31.46:5555/services/api/messaging/?to=131&message=hello’, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => ”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => ‘POST’, CURLOPT_POSTFIELDS =>'{ ..

Read more

I’m trying to get JSON from a URL using the codes below. I always get the errors below. <?php $url = …; $json = file_get_contents($url); $dados = json_decode($json, true); echo "<pre>"; print_r($dados); ?> Error: Warning: file_get_contents(https://www.car.gov.br/publico/imoveis/getImovel?lat=-2.449376438504347&lng=-49.04754638759188): Failed to open stream: Redirection limit reached, aborting in … on line 5 Another code used: <?php $url = ..

Read more

i’m trying to get the last 9 charachters of $span $span = ""; foreach($html->find(‘span’) as $element1){ if (strpos($element1->outertext, ‘kcal’) !== false){ $span .= $element1->outertext.'<br>’; } } echo substr($span,-9); it just show me white page any suggestions? edit: when i debug with var_dump($span) it shows exactly the following: string(761) " 1 Porsiyon (Orta) An├žuezSardalya Salatas─▒ 319 ..

Read more

<?php $parameters = array( "chat_id" => "93501313", "text" => "Hello", "disable_web_page_preview" => "true", "parse_mode" => "Markdown" ); send($parameters); function send($parameters) { $bot_token = "1409756432:AAGfblN66E888LKIUDUgVJt_dXtyFfFhGN0"; $url = "https://api.telegram.org/bot$bot_token/sendMessage"; if(!$ch = curl_init()){ exit(); } curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $outpot = curl_exec($ch); return $outpot; } ?> This is my code ..

Read more

hello i’m trying to extract the the value of span using the simple_html_dom.php $html = file_get_html(‘https://www.diyetkolik.com/kac-kalori/a/0/1/’); foreach($html->find(‘span.description float-right’,0) as $e) echo $e->nodeValue . ‘<br>’; any suggestion ? i tried loads of solutions on this plartform Sourc..

Read more