Jump to content

fsockopen Equivalent to this code?


devWhiz

Recommended Posts

<?php
    error_reporting(0);
$email = "";
$password = "";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.myspace.com/auth/login");	
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)');	
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'formLocation=splashForm&captchaHandler=%2FModules%2FPageEditor%2FHandlers%2FLogin%2F%7B0%7D.ashx&captchaResponse=&hash=MIGcBgkrBgEEAYI3WAOggY4wgYsGCisGAQQBgjdYAwGgfTB7AgMCAAECAmYDAgIAwAQIWWaRadlhotEEEA15tDCUhuiBjy8nd6RN3nEEUOoYRIpPoA1uOadO5d%252bIlVuABvbaJHaznd%252fYWuR4TWNS2GUAl1G3GQZjRPA3SL%252fUrRZuPbiFT3fBtQzYnvOaR1sP8KzrzVcLGCeUlIObGSsg&SMSVerifiedCookieToken=&NextPage=&js=1&Email='.urlencode($email).'&Password='.urlencode($password).'&Remember=true&loginBtn=');
curl_setopt($ch, CURLOPT_REFERER,'http://www.myspace.com/index.cfm?fuseaction=splash');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'login.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'login.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
file_put_contents('output.txt', curl_exec($ch));
curl_setopt($ch, CURLOPT_URL, "http://www.myspace.com/games/play/104283");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)');
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'login.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'login.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output2=curl_exec($ch);
if(stristr($output2, 'render.app#')){
preg_match('/\sid="apppanel_104283_canvas".*?render.app#([^&]+).*?viewerId=([0-9]+)/is', $output2, $matches);
$GameLink = "http://api.msappspace.com/apprendering/104283/canvas/04082011040014/1_0_0/render.app#".$matches[1];
echo '<font style="BACKGROUND-COLOR: 15317E"><a href="'.$GameLink.'"><font color="white">'.$email.'</font>';

}
sleep(1000);
curl_close($ch);



?>


 

I know this is possible to do the same exact thing with fsockopen, but I cannot get it for the life of me, any help is appreciated

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.