How to use cURL? — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberHosting

How to use cURL?

edited July 26 in General Discussion
im reading for: PHP: Spoof HTTP referer field with cURL.
https://thisinterestsme.com/php-spoof-http-referer-field/

<?php

//Initiate cURL.
$ch = curl_init();

//The URL cURL will be sending a request to.
curl_setopt($ch, CURLOPT_URL, 'http://test.com/');

//The referer we will give the website above.
curl_setopt($ch, CURLOPT_REFERER, 'https://m.facebook.com/');

//Follow any header redirects
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

//If there is a redirect, we want to keep the referral URL we
//set above.
curl_setopt($ch, CURLOPT_AUTOREFERER, true);

//Execute the cURL request.
$result = curl_exec($ch);

//Close the cURL handle.
curl_close($ch);

where can i add this code to work?
Tagged:
Tagged:
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!