curl_exec output to file instead of browser
So this is working when I echo the lines out, but when I perform the
curl_exec's it will return the following in my browser.
registerDomain-myip-Domain unavailable for registration.
registerDomain-myip-Domain unavailable for registration.
registerDomain-myip-Domain unavailable for registration.
Can I put the above to a file instead by modifying the code below?
<?php
date_default_timezone_set('UTC');
$lines = file('tocatch.txt');
$OPERATION = 'registerDomain';
$VERSION = '1';
$TYPE = 'xml';
$YOURAPIKEY = 'removed';
//
https://www.namesilo.com/api/OPERATION?version=VERSION&type=TYPE&key=YOURAPIKEY
foreach($lines as $line){
$REQUEST = 'https://www.namesilo.com/api/' .$OPERATION. '?version='
.$VERSION. '&type=' .$TYPE. '&key=' .$YOURAPIKEY. '&domain=' .$line.
'&years=1&private=1&auto_renew=1<br />';
$REQUEST = preg_replace('/\s/', '', $REQUEST);
// echo $REQUEST;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $REQUEST);
curl_exec($curl);
curl_close($curl);
}
?>
No comments:
Post a Comment