Hi,
That didn’t work unfortunately, i’ve pasted my php script below it basically uses curl to call a url that updates my prices. I’ve starred at my username and password. Can you let me know if it’s possible to integrate this with Clef?
Many thanks again
Steve
<?php
$username=’testaccount’;
$password=’testpassword’;
$url=’https://www.thegoldregister.co.uk/’;
$postdata = ‘log=’. $username .’&pwd=’. $password .’&wp-submit=Log%20In&redirect_to=’. $url .’wp-admin/&testcookie=1′;
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url . ‘wp-login.php’);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
//curl_setopt($ch, CURLOPT_CAINFO, getcwd() . “public_html/wp-content/plugins/goldregister/BuiltinObjectToken:GoDaddyClass2CA.crt”);
curl_setopt ($ch, CURLOPT_USERAGENT, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6’);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, $url . ‘wp-admin/’);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
$end = strpos($result, ‘Content-Type’);
$start = strpos($result, ‘Set-Cookie’);
$parts = split(‘Set-Cookie: ‘,substr($result, $start, $end-$start));
$cookies = array();
foreach ($parts as $co) {
$cd = split(‘;’,$co);
if (!empty($cd[0]))
$cookies[] = $cd[0];
}
curl_setopt ($ch, CURLOPT_URL, $url . ‘wp-admin/admin.php?page=Gold_Register_Import’);
curl_setopt ($ch, CURLOPT_COOKIE, implode(‘;’,$cookies));
curl_setopt ($ch, CURLOPT_HEADER, 0);
$result = curl_exec ($ch);
echo $result;
?>