Quantcast
Channel: WJunction - Webmaster Forum - QuickRDP.com- Upto 60% on rdp plans for ...
Viewing all articles
Browse latest Browse all 15793

IPT Login via PHP

$
0
0
I am trying to log in to IPT using my account via PHP.
So far i have got this:

PHP Code:

<?php
    
    login
(http://iptorrents.com","*** my POST-DATA would be here*** ")
    
echo grab_page("http://iptorrents.com");

    function 
login($url,$data){
        
$fp fopen("cookie.txt""w");
        
fclose($fp);
        
$login curl_init();
        
curl_setopt($loginCURLOPT_COOKIEJAR"cookie.txt");
        
curl_setopt($loginCURLOPT_COOKIEFILE"cookie.txt");
        
curl_setopt($loginCURLOPT_TIMEOUT40000);
        
curl_setopt($loginCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($loginCURLOPT_URL$url);
        
curl_setopt($loginCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
        
curl_setopt($loginCURLOPT_FOLLOWLOCATIONTRUE);
        
curl_setopt($loginCURLOPT_POSTTRUE);
        
curl_setopt($loginCURLOPT_POSTFIELDS$data);
        
ob_start();
        return 
curl_exec ($login);
        
ob_end_clean();
        
curl_close ($login);
        unset(
$login);    
    }                  
     
    function 
grab_page($site){
        
$ch curl_init();
        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
        
curl_setopt($chCURLOPT_TIMEOUT40);
        
curl_setopt($chCURLOPT_COOKIEFILE"cookie.txt");
        
curl_setopt($chCURLOPT_URL$site);
        
ob_start();
        return 
curl_exec ($ch);
        
ob_end_clean();
        
curl_close ($ch);
    }
     
    function 
post_data($site,$data){
        
$datapost curl_init();
            
$headers = array("Expect:");
        
curl_setopt($datapostCURLOPT_URL$site);
            
curl_setopt($datapostCURLOPT_TIMEOUT40000);
        
curl_setopt($datapostCURLOPT_HEADERTRUE);
            
curl_setopt($datapostCURLOPT_HTTPHEADER$headers);
        
curl_setopt($datapostCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
        
curl_setopt($datapostCURLOPT_POSTTRUE);
        
curl_setopt($datapostCURLOPT_POSTFIELDS$data);
            
curl_setopt($datapostCURLOPT_COOKIEFILE"cookie.txt");
        
ob_start();
        return 
curl_exec ($datapost);
        
ob_end_clean();
        
curl_close ($datapost);
        unset(
$datapost);    
    }
     
    
?>

For somereason it doesn't want to log in?
Is there something i am missing out? I am fairly new at php so i'm probably just missing a few parts unless i need some more code to handle a different part as it's a torrent website.
Any help would be appreciated.

__________________
Added after 17 minutes:

never mind, got it working. now, to tackle the grabbing info part and outputting it :)

Viewing all articles
Browse latest Browse all 15793

Trending Articles