I have made this code and ran it on my VPS to test for downloading from BTN but for some reason it is only downloading the .torrent
I just want to make sure this is the right way of logging into BTN
Thanks to anyone who can help me out B-)
I just want to make sure this is the right way of logging into BTN
PHP:
<?php
if(isset($_GET['sid'])) session_id(strip_tags($_GET['sid']));
session_start();
echo '<?xml version="1.0" encoding="UTF-8"?>';
$params = array('http' => array(
'method' => 'POST',
'content' => 'username=usernamehere&password=passwordhere&login=Log In!'
));
if ($optional_headers !== null) $params['http']['header'] = $optional_headers;
$ctx = stream_context_create($params);
$fp = @fopen('http://broadcasthe.net/login.php', 'rb', false, $ctx);
if (!$fp) die('Error connecting to BroadCasthe.net');
$response = @stream_get_contents($fp);
if ($response === false) die('Error connecting to BroadCasthe.net');
?>