Trying to make script to add in domain pointers from a textarea field:
But only the last domain from the list gets added.. any ideas please?
Code:
$data_array = explode("\n", $_REQUEST['domains']);
for ( $i=0, $size = count($data_array); $i<$size; $i++ )
{
$mydata = $data_array[$i];
$sock = new HTTPSocket;
$sock->connect('example.com',2222);
$sock->set_login("admin","123454366");
$sock->set_method('POST');
$sock->query('/CMD_API_DOMAIN_POINTER',
array(
'domain' => 'example.com',
'action' => 'add',
'from' => "$mydata",
'alias' => 'yes'
));
sleep(5);
}
But only the last domain from the list gets added.. any ideas please?