hi again
i wrote peice of script to check rapidshare account it gets some info of the account
lik expiration date whether its locked and points
everything is working perfect in localhost but when i upload it to server the function that take the points do not work evey other functions work perfectly except points
would you plz guide me whats wrong and why it work in local and do not work on server
<?php
function rcount ($array) {
$count = 0;
if (is_array($array)) {
foreach($array as $id=>$sub) {
if (!is_array($sub)) { $count++; }
else { $count = ($count + rcount($sub)); }
}
return $count;
}
return FALSE;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>checker</title>
</head>
<body style="background-color: #000000; color: #FFFFFF;">
<p align="center">
<?php
error_reporting(0);
include "config.php";
$logs = 'logs.txt' ;
$logsc = file_get_contents($logs) or printf('<br />Log file not found');
preg_match_all("/Accountid = (.*)<br \/>/" ,$logsc ,$idlist, PREG_PATTERN_ORDER);
preg_match_all("/Password = (.*)<br \/>/" ,$logsc ,$passlist, PREG_PATTERN_ORDER);
if (rcount($passlist) == 0)
echo '<br /><br />No accounts in log file';
for($i=0;$i < rcount($passlist)/2; $i++)
{
$rs = 'https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi?login='.$idlist[1][$i].'&password='.$passlist[1][$i].'';
//please note cURL is an absolute bitch...
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $rs);
curl_setopt ($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$page = curl_exec ($ch);
curl_close ($ch);
if(preg_match('/var schlosszu/', $page))
{
preg_match('/var schlosszu = "([0-9]+)"/', $page, $locked);
preg_match('/<td>Expiration date:<\/td><td style="padding-right:20px;"><b>(.*)<\/b><\/td>/', $page, $expires);
preg_match("/<td>Free RapidPoints:<\/td><td align=right style=\"padding-right:20px;\"><b><span id=\"rpo\">([0-9\.]+)<\/span><\/b><\/td>
/", $page, $points);
echo '<br /><br />Account = '.$idlist[1][$i].'<br />Password = '.$passlist[1][$i].'<br />';
if ($locked[1] == 1)
echo 'Account Locked<br />';
else
echo 'Account Unlocked<br />';
echo 'Expires = '.$expires[1].'<br />';
echo 'Points = '.$points[1].'<br />';
}
else
{
echo '<br /><br />Account '.$idlist[1][$i].' is invalid<br />';
}
}
?>
</p>
<br />
</body>
</html>