PHP Curl failed to post data - php

I am coding an aubook appointment script using PHP. There is a calendar with available dates to book.
I successfully do logging, I successfully get random dates, I successfully get available dates parameters, then finally I fail to post data and book the appointment.
After I successfully book with this simple script, I have to make a condition - if there is an avaliable dates try to book else continue to refresh
<?php
set_time_limit(0);// to infinity for
$ch = curl_init();
$headers[] = "Accept: */*";
$headers[] = "Connection: Keep-Alive";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/login.php');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$co = curl_exec($ch);
$doc = new DOMDocument();
libxml_use_internal_errors(true);
$doc->loadHTML($co);
# Parse the HTML
# The # before the method call suppresses any warnings that
# loadHTML might throw because of invalid HTML in the page.
$xpath = new DOMXPath($doc);
$val1 = $xpath->query('//input[#name="_sid"]/#value')->item(0)->nodeValue;
echo $val1;
echo '<br/>';
$field['process'] = 'login';
$field['_sid'] = $val1;
$field['email'] = 'myemail#example.com';
$field['pwd'] = '123456';
$datafield = http_build_query($field);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $datafield);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/myapp.php?fg_id=5568094');
$cur = curl_exec($ch);
$do = new DOMDocument(); // New dom Doc to Get URL from calender of avaliable dates
libxml_use_internal_errors(true);
$do->loadHTML($cur);
# Parse the HTML
# The # before the method call suppresses any warnings that
# loadHTML might throw because of invalid HTML in the page.
$xpath = new DOMXPath($do);
$onClickAttrNodeList = $xpath->query('//a[#class="dispo"]/#onclick'); //array contains URL
$array = array(); // CONVERT NODE LIST OBJECT TO ARRAY
foreach($onClickAttrNodeList as $node){
$array[] = $node;
}
$x=array();
foreach($array as $node) {
for($i = 0; $i < 10; ++$i) {
$x[] = $node->nodeValue; //PARSE ALL LINK AS TABLE
}
}
$randlink = array_rand($x, 10); //get gandom link from calender of avaliable dates
$link = $x[$randlink[0]];
echo '<br/>';
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $link, $match); //Get URL from the last array
echo "<pre>";
$url = $match[0];
print_r($url[0]);
echo'<br/>';
parse_str( parse_url( $url[0], PHP_URL_QUERY), $arrayurl ); // GET parametres from the URL of avaliable dates to book
var_dump($arrayurl);
/* in this part of code
i am trying to post
parametres to book
an appottment i failed on this step */
$fieldbook['timestamp'] = $arrayurl[0];
$fieldbook['skey'] = $arrayurl[1];
$fieldbook['process'] = $arrayurl[2];
$fieldbook['what'] = $arrayurl[3];
$fieldbook['fg_id'] = $arrayurl[4];
$fieldbook['result'] = $arrayurl[5];
$fieldbook['issuer_view'] = $arrayurl[6];
$datafieldbook = http_build_query($fieldbook);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/action.php');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $datafieldbook);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/myapp.php?fg_id=5568094');
$book = curl_exec($ch);
echo'<br/>';
echo $book;
curl_close($ch);
?>
Thank you .

Problem solved , i have just Add user agent and some headers .
Thank you guys :-).

Related

Form login and post parameters by curl

I need to login into R-studio in order to grab (curl) an image.
I use the procedure as below, but it does not return the image, just the form itself.
This is the location of the form:
http://skiweather.eu:8787/auth-sign-in
<?php
$username = 'admin';
$password = 'XXX';
$loginUrl = 'http://skiweather.eu:8787/auth-do-sign-in';
$sign=1;
$cookie= "cookies.txt";
//init curl
$ch = curl_init();
//Handle cookies for the login
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true)
//Set the URL to work with
curl_setopt($ch, CURLOPT_URL, $loginUrl);
// ENABLE HTTP POST
curl_setopt($ch, CURLOPT_POST, 1);
$response = curl_exec($ch);
if (curl_errno($ch)) die(curl_error($ch));
$dom = new DomDocument();
$dom->loadHTML($response);
$tokens = $dom->getElementsByTagName("meta");
for ($i = 0; $i < $tokens->length; $i++)
{
$meta = $tokens->item($i);
if($meta->getAttribute('name') == 'csrf-token')
$token = $meta->getAttribute('content');
}
$postinfo = 'username='.$username.'&password='.$password.'&staySignedIn=1&appUri='.$loginUrl.'&_csrf='.$token;
echo $token; //debug info
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
//set the URL to the protected file
curl_setopt($ch, CURLOPT_URL, 'http://skiweather.eu:8787/files/R/devel/PLOTS/snowalert_today_0.png');
//execute the request
$content = curl_exec($ch);
curl_close($ch);
//save the data to disk
file_put_contents('pppp.png', $content);
?>

Combining PHP CURL and DOM

I have a code that combines CURL and DOM. My code:
<?php
// Create temp file to store cookies
$ckfile = tempnam ("/tmp", "CURLCOOKIE");
// URL to login page
$url = "https://www.investagrams.com/login";
// Get Login page and its cookies and save cookies in the temp file
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
#$output = curl_exec($ch);
$fields = array(
'ctl00$WelcomePageMainContent$ctl00$Username' => '********',
'ctl00$WelcomePageMainContent$ctl00$Password' => '********',
);
$fields_string = '';
foreach($fields as $key=>$value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
// Post login form and follow redirects
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
#$output = curl_exec($ch);
$url = "https://www.investagrams.com/Stock/RealTimeMonitoring";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
#echo $output;
$dom = new DomDocument;
$dom->loadHtmlFile($output);
$xpath = new DomXPath($dom);
// collect header names
$headerNames = array();
foreach ($xpath->query('//table[#id="StockQuoteTable"]//th') as $node) {
$headerNames[] = $node->nodeValue;
}
// collect data
$data = array();
foreach ($xpath->query('//tbody[#id="StockQuoteTable:tbody_element"]/tr') as $node) {
$rowData = array();
foreach ($xpath->query('td', $node) as $cell) {
$rowData[] = $cell->nodeValue;
}
$data[] = array_combine($headerNames, $rowData);
}
print_r($data);
?>
This loads to just "Arrays():"
Here's the info of table I want to extract:
I don't know which part is wrong. The Curl part is 100% working, the error is in DOM part. Thank you
<div class="dataTables_scrollBody" style="overflow: auto; height: 300px; width: 100%;">
<table id="StockQuoteTable" class="table dataTable no-footer" role="grid" aria-describedby="StockQuoteTable_info" style="width: 1166px;">
<thead></thead>
<tbody>
<tr id="num1" class="odd" role="row"
I was able to find out part of the problem with your code, however it seems that the HTML code supplied from the curl request seems to have some errors in it preventing the function DOMXPath::query from returning a valid match.
The problem I was able to fix in your code was caused by you using DOMDocument::loadHTMLfile instead of DOMDocument::loadHTML to include the HTML retrieved from your curl request. So the valid script should be:
<?php
// Create temp file to store cookies
$ckfile = tempnam ("/tmp", "CURLCOOKIE");
// URL to login page
$url = "https://www.investagrams.com/login";
// Get Login page and its cookies and save cookies in the temp file
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
#$output = curl_exec($ch);
$fields = array(
'ctl00$WelcomePageMainContent$ctl00$Username' => '********',
'ctl00$WelcomePageMainContent$ctl00$Password' => '********',
);
$fields_string = '';
foreach($fields as $key=>$value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
// Post login form and follow redirects
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
#$output = curl_exec($ch);
$url = "https://www.investagrams.com/Stock/RealTimeMonitoring";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Accepts all CAs
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
#echo $output;
#print_r($output);
$dom = new DomDocument;
#$dom->loadHtml($output);
$xpath = new DomXPath($dom);
// collect header names
$headerNames = array();
foreach ($xpath->query('//table[#id="StockQuoteTable"]//th') as $node) {
$headerNames[] = $node->nodeValue;
}
// collect data
$data = array();
foreach ($xpath->query('//tbody[#id="StockQuoteTable:tbody_element"]/tr') as $node) {
$rowData = array();
foreach ($xpath->query('td', $node) as $cell) {
$rowData[] = $cell->nodeValue;
}
$data[] = array_combine($headerNames, $rowData);
}
print_r($data);
?>
Additionally I added an # symbol before the loadHTML function to suppress errors.

Extracting TD Information with DOMXPath

I'm using the following code to get information from a specific table column, but I keep getting the following error:
Object of class DOMElement could not be converted to string
Here is the table column I'm trying to get information from:
<td id="billing_address">1099 Somewhere Lane<br /> Some City, IL 60118</td>
Here is the CURL script to get the information:
$url = "http://www.somesite.com";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt($ch, CURLOPT_POST, 3);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$result = curl_exec($ch);
$document = new DOMDocument();
#$document->loadHTML($result);
$xp = new DOMXpath($document);
$nodes = $xp->query('//td[#id="billing_address"]');
$node = $nodes->item(0);
$client_info = $node;
echo $client_info;
curl_close($ch);
Thanks to Lauris, I was able to get the content to display using this:
$client_info = $node->nodeValue;
echo $client_info;
The problem is that I noticed the line break tags separating the lines are missing when echoed. What I need is to be able to differentiate the different lines that are separated by the tags.
I figured I would just grab whatever was between the tags with the id of billing_info, and then use the PHP explode function to parse out the individual lines. But the tags aren't there for me to do that.

curl is not collecting all the cookies from external site

for some reason , its not collecting all the cookies, its not collecting the password hash or the member id , im not sure why its not setting those since its getting the others, am i doing somthing wrong with my coding, this is my first time using curl
this is the information in the cookie.txt file
<?php
//init curl
function curl_file_get_contents($url){
$username = 'user#hotmail.com';
$password = 'mypass';
$loginUrl = 'http://forums.zybez.net/index.php?app=curseauth&module=global&section=login';
//init curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_URL, $loginUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'user=' . $username . '&pass=' . $password);
$store = curl_exec($ch);
curl_setopt($ch, CURLOPT_REFERER, 'http://forums.zybez.net/runescape-2007-prices/282-law+rune');
$content = curl_exec($ch);
curl_close($ch);
file_put_contents('~/download.zip', $content);
$curl = curl_init();
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl, CURLOPT_REFERER, $loginUrl);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_FAILONERROR, TRUE);
$contents = curl_exec($curl);
return $contents;
curl_close($curl);
}
function get_input_tags($html){
$post_data = array();
// a new dom object
$dom = new DomDocument;
//load the html into the object
$dom->loadHTML($html);
//discard white space
$dom->preserveWhiteSpace = false;
//all input tags as a list
$input_tags = $dom->getElementsByTagName('input');
//get all rows from the table
for ($i = 0; $i < $input_tags->length; $i++) {
if (is_object($input_tags->item($i))) {
$name = $value = '';
$name_o = $input_tags->item($i)->attributes->getNamedItem('name');
if (is_object($name_o)) {
$name = $name_o->value;
$value_o = $input_tags->item($i)->attributes->getNamedItem('value');
if (is_object($value_o)) {
$value = $input_tags->item($i)->attributes->getNamedItem('value')->value;
}
$post_data[$name] = $value;
}
}
}
return $post_data;
}
/*
Usage
*/
error_reporting(~E_WARNING);
function getauth(){
$html = curl_file_get_contents("http://forums.zybez.net/runescape-2007-prices/282-law+rune");
echo "<pre>";
$auth1 = (get_input_tags($html));
$auth = $auth1["auth"];
print_r($auth1);
}
getauth();
?>

Logging in and downloading content using PHP and CURL

I'm trying to log in to site and then go to one of the pages and retrieve the data. I have a problem with authorization.
Sample code:
$loginUrl = 'https://strona.pl/authorization'; //action from the login form
$loginFields = array('username'=>'mail#mojmail.pl', 'password'=>'haslo'); //login form field names and values
$remotePageUrl = 'https://strona.pl/pdstrona'; //url of the page you want to save
$login = getUrl($loginUrl, 'post', $loginFields); //login to the site
$remotePage = getUrl($remotePageUrl); //get the remote page
function getUrl($url, $method='', $vars='') {
$ch = curl_init();
if ($method == 'post') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies/cookies.txt');
$buffer = curl_exec($ch);
//jeżeli pojawił się błąd to go wyświetlimy
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
return $buffer;
print $status;
}
// wyłącza pokazywanie błędów dla funkcji loadHTML
libxml_use_internal_errors(true);
$dom = new DOMDocument;
$dom ->strictErrorChecking = FALSE;
$dom->loadHTML($remotePage);
$xpath = new DOMXpath($dom);
As a result of this query I am redirected to the main page (not the sub). What is important, I enter email address into a script in encoded form. Example: email% 40mojmail.pl
edit
Ok - I will add some information . I am a publisher and working with afilo.pl . Daily checking of rates is very tiring, so I wanted to prepare a script that will collect data once a day and informed me of the changes.
Unfortunately I can not retrieve the data.
Sample cookies from my browser :
Set- Cookie: PHPSESSID = jat102p33s0pmfairri1qiih24 ; expires = Thu, 25 -Dec- 2013 9:16:40 p.m. GMT ; path = / ; domain = . Afilo.pl
I modified the code but it still does not work.
loginUrl = 'https://opentrack.afilo.pl/logowanie'; //action from the login form
$loginFields = array('loginemail'=>'.......','loginhaslo'=>'........');
//login form field names and values
$remotePageUrl = 'https://opentrack.afilo.pl/partner/programy-lista'; //url of the page you want to save
$login = getUrl($loginUrl, 'post', $loginFields); //login to the site
$remotePage = getUrl($remotePageUrl); //get the remote page
function getUrl($url, $method='', $vars='') {
$ch = curl_init();
if ($method == 'post') {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
}
session_start();
$strCookie = session_name() . '=' . $_COOKIE[ session_name() ] . '; path=/; domain=.afilo.pl';
session_write_close();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies/cookies.txt');
//curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies/cookies.txt');
curl_setopt( $ch, CURLOPT_COOKIE, $strCookie );
$buffer = curl_exec($ch);
//je¿eli pojawi³ siê b³¹d to go wyœwietlimy
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
return $buffer;
print $status;
}
This is the answer to my question. This code works well.
// options
$EMAIL = 'login';
$PASSWORD = 'haslo';
$cookie_file_path = "/cookies/cookies.txt";
$LOGINURL = "https://domainname.com/auth";
$agent = "Nokia-Communicator-WWW-Browser/2.0 (Geos 3.0 Nokia-9000i)";
$ch = curl_init();
$headers[] = "Accept: */*";
$headers[] = "Connection: Keep-Alive";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_URL, $LOGINURL);
$fields = array();
$fields['loginemail'] = $EMAIL;
$fields['loginhaslo'] = $PASSWORD;
$POSTFIELDS = http_build_query($fields);
curl_setopt($ch, CURLOPT_URL, $LOGINURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $POSTFIELDS);
$result = curl_exec($ch);
$remotePageUrl = 'https://domainname.com/partner/programy-lista';
curl_setopt($ch, CURLOPT_URL, $remotePageUrl);
$result = curl_exec($ch);

Categories