11 March 2015

jolo.in alternative

In the recent days, jolo.in free recharge api provider has become more worse than ever. no recharge was successful but the amount getting deducted ,emailed them (sales@jolo.in) couple of times  asking whats going on? no reply yet.

my previous blog post was about mobikwik recharge api.  so in this post i am writing to tell you all how i migrated to mobikwik api without disturbing my current site setup.

here is the trick for Operator code mapping

$op='AT'; //operator code for jolo

$ops=array(
'AT'=>array('op'=>1),
'BS'=>array('op'=>3),
'BSS'=>array('op'=>3,'pvalue'=>'specialRecharge'),
'AL'=>array('op'=>6),
'ID'=>array('op'=>8),
'VF'=>array('op'=>2),
'TD'=>array('op'=>11),
'TDS'=>array('op'=>11,'pvalue'=>'specialRecharge'),
'TI'=>array('op'=>9),
'MS'=>array('op'=>13),
'UN'=>array('op'=>16),
'UNS'=>array('op'=>16,'pvalue'=>'specialRecharge'),
'LM'=>array('op'=>10),
'RL'=>array('op'=>4),
'RG'=>array('op'=>5),
'VD'=>array('op'=>17),
'VDS'=>array('op'=>17,'pvalue'=>'specialRecharge')
);

$opr=http_build_query($ops[$op]);

$uid='email@example.com';  //your mobikwik username probably email id
$pwd='123456';  //your mobikwik password

$amt=; //amount variable
$cn=; //cell number variable

$cir=11; //this can be ignored

$mapp=md5($amt.$pwd.$cn.$uid.'c489hrvv56NV9IVYCY4YER56GRYYB&^fn980b3678b7zv58Z&*VV79V789TV58955T78VTV5');

$url="https://appapi.mobikwik.com/recharge.do?uid=$uid&pwd=$pwd&cn=$cn&$opr&cir=$cir&amt=$amt&reqid=android&mapp=$mapp";

$xml=file_get_contents($url);
$array=simplexml_load_string($xml);
//echo $url;
print_r($array);

if($array->status=='SUCCESS')
{
$txnid=$array->txId;
//do something
}

if($array->status=='SUCCESSPENDING')
{
$txnid=$array->txId;
//do something
}

5 February 2015

mobikwik recharge api

<?php

$uid='';  //your mobikwik username probably email id
$pwd='';  //your mobikwik password

$amt=10; //amount
$cn=9895098951; //cell number

$op=1; //operator id see below for list
$cir=11; //circle id see below for list

$mapp=md5($amt.$pwd.$cn.$uid.'c489hrvv56NV9IVYCY4YER56GRYYB&^fn980b3678b7zv58Z&*VV79V789TV58955T78VTV5');

$url="http://appapi.mobikwik.com/recharge.do?uid=$uid&pwd=$pwd&cn=$cn&op=$op&cir=$cir&amt=$amt&reqid=android&mapp=$mapp";

$xml=file_get_contents($url);
$array=simplexml_load_string($xml);

print_r($array);

?>

Operator and Circle

OperatorID    Operator
1    Airtel
2    Vodafone
3    BSNL
4    Reliance CDMA
5    Reliance GSM
6    Aircel
7    MTNL ( Pin based only)
8    Idea
9    Tata Indicom
10    Loop Mobile
11    Tata Docomo
12    Virgin CDMA
13    MTS ( Pin based only)
14    Virgin GSM
15    S Tel


Circle ID    Circle
1    Andhra Pradesh
2    Assam
3    Bihar & Jharkhand   
4    Chennai
5    Delhi & NCR
6    Gujarat
7    Haryana
8    Himachal Pradesh
9    Jammu & Kashmir
10    Karnataka
11    Kerala
12    Kolkata
13    Maharashtra & Goa (except Mumbai)
14    MP & Chattisgarh
15    Mumbai
16    North East
17    Orissa
18    Punjab
19    Rajasthan
20    Tamilnadu
21    UP(EAST)
22    UP(WEST) & Uttarakhand
23    West Bengal


P.S: MobiKwik is a Bitch.
Enjoy the Bitch ;)

28 December 2014

Find rank of user(s) using mysql query

SELECT 1 + (
SELECT count( * )
FROM user a
WHERE a.balance > b.balance ) AS rank,id
FROM user b
ORDER BY rank;


table structure
---------------

id balance
1 0.50
2 0.25
3 0.10
4 1.20


output
------
rank id
1 4
2 1
3 2
4 3


if you want get rank of a specific user use where clause like this

SELECT 1 + (
SELECT count( * )
FROM user a
WHERE a.balance > b.balance ) AS rank,id
FROM user b WHERE id='1'
ORDER BY rank;





17 April 2013

import GeoIP csv to MySQL DB provided by MaxMind

you can download GeoIP csv database from http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip

unzip  and extract the csv file just upload it your web server

$ips=explode("\n",file_get_contents('GeoIPCountryWhois.csv'));
foreach($ips as $ip)
{
$ip=str_replace('"',"'",$ip); //this variable cantains sample string '1.0.0.0','1.0.0.255','16777216','16777471','AU','Australia'   which means you can use this string directly in mysql insert query







//perform your mysql insert query here

}


that is all :))

14 April 2013

How To get Resellerclub Slab 2 Pricing

I am Going To tell you how you can get resellerclub slab 2 pricing without any initial deposit.
Its hard to achieve slab 2 pricing for small hosting providers and freelancers.
If you want to get Directly slab 2 pricing for domain registration Then You can Go for http://www.india.dj
who can provide you .com / .net /.org domain registration starting from 9$ per year registration and renewal, with cheapest registrar for .in domain names. :)


We accept payments By PayPal and Ccavenue.
Domain Registration

30 March 2013

form auto save using jquery

whenever any changes occurs in the form this will make ajax request to save the form data



jQuery(document).ready(
function()
{
jQuery('#form').change(function(e)
{
var str = jQuery("#form").serialize(); //post variables present in the form input,select and all inputs
jQuery.ajax({
type: "POST", //method
url: "/save.php", //url to make request
data: str
}); //end of ajax
});// end of form change

});

1 March 2013

fetch google contacts using access_token and parse it

<?php
$access_token=$_GET['access_token'];
$max_results=$_GET['max_results'];
$api_url="https://www.google.com/m8/feeds/contacts/default/full";
$emails=array();
$content=file_get_contents("$api_url?access_token=$access_token&max-results=$max_results");

//https://www.google.com/m8/feeds/contacts/default/full?access_token=<your access token>&max-results=<maximum contacts>

$parser = xml_parser_create();
xml_parse_into_struct($parser, $content, $contacts);
xml_parser_free($parser);
foreach($contacts as $contact)
{
if($contact[tag]=="GD:EMAIL")
{
$emails[]=$contact[attributes][ADDRESS];
}
}
print_r($emails);//array of all email address
?>