View Full Version : (phpscript) T-Mobile flext allowance left



plea
27th June 2009, 02:56
Upload to your own host keeping your account private.
usage:-
[Only registered and activated users can see links]

WARNING..... this script is only for private use. Never give user/pass to an account on a public service. I have this hosted on my own server so know the log files arnt overlooked. Hardcoded user/pass could also be viewed by sysadmins. Use at own risk.

Upload the following to your host for a simple script to display what allowance you have left in a prepaid flext account.
could be very quickly edited for other urls or account types.



<?php
$postdata = "username=".$_GET['u']."&password=".$_GET['p']."&saveUserName=on&submit=Log+in";

$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($curl, CURLOPT_COOKIEFILE, "cookie-jar.txt");
curl_setopt($curl, CURLOPT_COOKIEJAR, "cookie-jar.txt");
curl_setopt($curl, CURLOPT_URL, "[Only registered and activated users can see links]");
$xxx = curl_exec($curl);

curl_setopt($curl, CURLOPT_URL, "[Only registered and activated users can see links]");
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$xxx = curl_exec($curl);

# basic user/password error checking
if (strpos($xxx,"Invalid password") > 0 || strpos($xxx,"Please enter a valid username and password") > 0) {
echo "error";
return;
}

curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_URL, "[Only registered and activated users can see links]");
$xxx = curl_exec($curl);

curl_close ($curl);


$thing = substr($xxx,strpos($xxx,"Welcome to My T-Mobile"));
$thing = substr($thing,strpos($thing,",")+2);
$name = substr($thing,0,strpos($thing,"<"));

$thing = substr($thing,strpos($thing,"You last logged in"));
$last = substr($thing,0,strpos($thing,"<"));

$thing = substr($thing,strpos($thing,"Items will be billed on"));
$nextbill = substr($thing,24,10);

$thing = substr($thing,strpos($thing,"Flext Allowance:"));
$thing = substr($thing,strpos($thing,"<td>")+4);
$left = substr($thing,0,strpos($thing,"<"));


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[Only registered and activated users can see links]">
<html xmlns="[Only registered and activated users can see links]" lang="en" xml:lang="en">
<head>
<title><?php echo $name." logged in"; ?></title>
</head>
<body>
<?php
echo "<p>".$last."</p>";
echo "<p>Next billing date - ".$nextbill."</p>";
echo "<p>Remaining Flext Allowance - ".$left."</p>";
?>
</body>
</html>

<?php
# echo $xxx;


?>


Create cookie-jar.txt chmod 777

Idea sourced from [Only registered and activated users can see links]