Search
 
SCRIPT & CODE EXAMPLE
 

PHP

curl exec not working php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy); // $proxy is ip of proxy server
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

$httpCode = curl_getinfo($ch , CURLINFO_HTTP_CODE); // this results 0 every time
$response = curl_exec($ch);

if ($response === false) 
    $response = curl_error($ch);

echo stripslashes($response);

curl_close($ch);
Comment

PREVIOUS NEXT
Code Example
Php :: laravel hasfile 
Php :: ci db query error 
Php :: PHP Warning: Version warning: Imagick was compiled against Image Magick version 1654 but version 1650 is loaded. 
Php :: How To Force Redirect HTTP To HTTPS In Laravel Using htaccess 
Php :: get order details by id woocommerce 
Php :: php trim string to length 
Php :: blade set variable 
Php :: php add to associative array 
Php :: wordpress get post slug 
Php :: carbon two day ago 
Php :: install mess detector 
Php :: Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php 
Php :: how match array in laravel collection 
Php :: Session store not set on request. 
Php :: laravel check record exists 
Php :: Laravel 9 Clear Cache of Route, View, Config, Event Commands 
Php :: php replace every occurrence of character in string 
Php :: laravel query builder sum 
Php :: search on taxonomy wordpress query 
Php :: php open csv 
Php :: how to force delete in laravel 8 
Php :: laravel if syntax 
Php :: Failed to authenticate on SMTP server with username 
Php :: laravel get subdomain 
Php :: laravel with has 
Php :: php remove last 3 letters from string 
Php :: how to use php echo data in javascript 
Php :: if is alphabet php 
Php :: time in php 
Php :: php install dependency 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =