Results 1 to 1 of 1
-
25th Nov 2011, 06:58 AM #1OPBannedWebsite's:
Seecure.me[PHP] Log into WUpload using CURL
[PHP] Log into WUpload using CURL
Code:<?php set_time_limit(300); error_reporting(0); /** * @author midoalone * @copyright 2011 * @filename login.php * @creationDate 5/11/2011 */ #-- The main function to login the wupload.com --# function wupload_login($email, $password, $url='http://www.wupload.com/account/login'){ // Initiate the curl method $ch = curl_init(); // Set the login url curl_setopt($ch, CURLOPT_URL, $url); // Prevent the print out of the received data curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Enable sending data with the POST method curl_setopt ($ch, CURLOPT_POST, 1); // Include the post variable that represt the login form elements curl_setopt ($ch, CURLOPT_POSTFIELDS, 'email='.$email.'&password='.$password); // Handle cookies and save them into a file curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); // Excute the curl request $store = curl_exec ($ch); // Close curl curl_close ($ch); if($store == 1){ echo "Unable to Login."; }else{ echo "Logged In."; } } #--- Function to load a url that need login --# function loadUrl($url='http://www.wupload.com/account/settings'){ $cr = curl_init($url); curl_setopt($cr, CURLOPT_RETURNTRANSFER, true); curl_setopt($cr, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // Use cookie.txt for READING cookies curl_setopt($cr, CURLOPT_COOKIEFILE, 'cookie.txt'); $output = curl_exec($cr); curl_close($cr); echo $output; } function UserInfo($email, $password) { $url = "http://api.wupload.com/user?method=getInfo&u=$email&p=$password"; $userinfo = curl_init($url); curl_setopt($userinfo, CURLOPT_RETURNTRANSFER, true); curl_setopt($userinfo, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($userinfo, CURLOPT_COOKIEFILE, 'cookie.txt'); $returnUserInfo = curl_exec($userinfo); $regex_id = '/id":(.+?),/'; $regex_email= '/email":(.+?),/'; $regex_nickname = '/nickname":(.+?),/'; $regex_isPremium = '/"is_premium":(.+?)}/'; preg_match($regex_id, $returnUserInfo, $match_id); preg_match($regex_email, $returnUserInfo, $match_email); preg_match($regex_nickname, $returnUserInfo, $match_nickname); preg_match($regex_isPremium, $returnUserInfo, $match_premium); echo "<br />User ID: ".$match_id[1]."<br />"; echo "Email : ".$match_email[1]."<br />"; echo "Nickname : ".$match_nickname[1]."<br />"; echo "isPremium : ".$match_premium[1]."<br />"; } UserInfo("vickkumar2011@gmail.com", "password"); ?>
http://forum.phpcanyon.net/index.php...ad-using-curl/_Vick Reviewed by _Vick on . [PHP] Log into WUpload using CURL Log into WUpload using CURL <?php set_time_limit(300); error_reporting(0); /** * @author midoalone * @copyright 2011 * @filename login.php * @creationDate 5/11/2011 Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Curl to Uploaded.to
By skinner in forum Web Development AreaReplies: 18Last Post: 12th Feb 2012, 07:05 AM -
[PHP] A simpler way to log into wUpload using PHP and CURL
By _Vick in forum Web Development AreaReplies: 8Last Post: 29th Nov 2011, 12:17 PM -
Remove Wupload Internal Remote Upload(Wupload to Wupload)?
By jbisana17 in forum File Host DiscussionReplies: 57Last Post: 22nd Nov 2011, 01:26 AM -
Curl IPB help
By xwarlordx in forum Web Development AreaReplies: 3Last Post: 23rd Aug 2011, 06:33 AM -
need help in filesonic/wupload download using curl
By saninokia in forum Web Development AreaReplies: 1Last Post: 30th Jul 2011, 04:11 PM
themaRegister - register to forums...
Version 3.54 released. Open older version (or...