Nah,
I'm just going to fix it with using the API

PHP Code: 
foreach($dlinks as $host => $urls){
  
$links .= generate_links($host,$urls);

Would become
PHP Code: 
foreach($dlinks as $host => $urls){
  
$post = array();
  
$post['links'] = implode("\n",$urls);
  
$post['userID'] = $userID;
  
$post['host'] = $host;
  
$links .= getpage('http://api.file-remoter.com/?act=generate',$post);

I know it's not good practice. But fuck it