Questions tagged [php-curl]

PHP cURL extension for HTTP requests

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

These functions have been added in PHP 4.0.2.

Source

1306 questions
-1
votes
2 answers

PHP IF statement testing decoded JSON data

I want to send received JSON data to a PHP CURL script I've written on my server to then forward the data to multiple external webhook URLs conditioned on data received in a specific field key/value. However, either my IF statement is misconfigured…
tommycopeland
  • 59
  • 1
  • 11
-1
votes
2 answers

Problem with stack Exchange api curl operation in PHP json parsing

I am using StackExchange get all answers API to my project. so that I am hitting the URL https://api.stackexchange.com/2.2/answers?page=10&pagesize=10&order=desc&sort=activity&site=stackoverflow While hitting in browser the original json shows, but…
-1
votes
1 answer

Why is this cURL post request to login not working?

I am trying to login here. When I login manually and check the browser console -> network -> post -> headers/parameters, I get the following:- form_key: viiRqZigH0YPC9wu login[username]: myusername login[password]: mypassword send: Please note…
Grey-lover
  • 635
  • 3
  • 7
  • 21
-1
votes
1 answer

Why does Google Drive API / Oauth2 refresh token request, returns an error saying "SSL is required to perform this operation."?

i'm new to OAuth2 and it confuses me why my refresh token request gets a response of "SSL is required to perform this operation." when obviously we got an SSL free from DigitalOcean. public function refresh_token($test = false){ $url =…
Nyuu
  • 65
  • 1
  • 8
-1
votes
1 answer

Are Post and Get methods part of the PHP language or URL

To understand the post and get methods, should I Get a book on URL or PHP?
user8448947
-1
votes
2 answers

Sending message using Telegram api

I have some PHP code to sending message to Telegram_bot: $telegrambot = "xxxxxxx"; $website="https://api.telegram.org/bot".$telegrambot; $chatId=yyyyyyy; $params=array('chat_id'=>$chatId,'text'=>$msg,); $ch = curl_init($website .…
Avan
  • 25
  • 1
  • 2
-1
votes
1 answer

curl_exec pulling wrong HTML vs string passed to curl_init

My curl request string is created programmatically with a base URL from a database and an integer which is the page number. The string for the URL is correct. If I call the curl request with the base URL copied in to the function, it works. If I…
Thomas
  • 11
  • 1
  • 4
-1
votes
1 answer

need some information about php curl

Please before my question please see those data 1st. API URL: https://api.awebsite.com/api/redeem Data Sent Method: POST Requested Headers: Host: api.awebsite.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101…
I Am Stack
  • 231
  • 3
  • 18
-1
votes
1 answer

How can I make this PHP script run faster/asynchronously?

I have a pastebin scraper script, which is designed to find leaked emails and passwords, to make a website like HaveIBeenPwned. Here is what my script is doing: - Scraping Pastebin links from https://psbdmp.ws/dumps - Getting a random proxy using…
-1
votes
1 answer

PHP Curl - Unable to access item second level in array

I have a small PHP curl script that's accessing an API URL. This is the last part of it: $response = curl_exec($curl); $err = curl_error($curl); $re = json_decode($response, true); var_dump($re); $item = $re['access_token']; …
PassCode
  • 41
  • 6
-1
votes
1 answer

How can I display a website's homepage on my own site?

I'm trying to create a portfolio website to showcase my talents as a web developer and drum up some extra freelance clients. To that end, I'd like to have a Bootstrap carousel of iframes that display the home pages of previous sites that I've worked…
Kenny83
  • 769
  • 12
  • 38
-1
votes
2 answers

how to send access token using CURL PHP

I am new in CURL I need to authenticate user is logged in or not using access token. But how to send x-access-token with post request into header. I am using. curl library require __DIR__ . '/vendor/autoload.php'; use \Curl\Curl; $curl = new…
Devendra Chauhan
  • 2,567
  • 2
  • 10
  • 12
-1
votes
2 answers

linux curl -F to php curl - contact everyone API

I try to use the following API to make automatic call with audio files : https://contact-everyone.orange-business.com/api/docs/guides/index.html?shell#cr-er-une-diffusion-vocale The 'linux cURL' code is the following one (on the right in the…
JeremDem
  • 51
  • 1
  • 11
-1
votes
2 answers

send multiple json data into api

I want to send these three array data into the external api. For that firstly I encode this into JSON, but always it sends the last array. $params = array( array('receiverName' => 'sample_name', 'receiverEmail' =>…
-1
votes
1 answer

How to scrape any type of website

I am working on scraping websites, I have tried many technologies to scrape websites. First of all I used PHP cURL as a scraping tool, and went up to some extent to scrape websites, but then I faced a problem, that was; the PHP cURL couldn't scrape…
Nadeem Ahmad
  • 665
  • 3
  • 17
  • 40