Friday, May 28, 2010

Integrate Firebug Lite with all browser

Integrate Firebug lite with all available browser like Crome,Safari,IE

firebug is most advance tool for correct or check web page design like css,html tags.

It hard to install firebug to all browser. only mozilla firefox support the installation of firebug.

For using firebug in browser just copy below code and past it to before &lt/body &gt tag. So firebug lite link will appear on click firebug will work for that page on which that code present.

<a href="javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E=F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','','#startOpened');">Firebug Lite</a>

Wednesday, May 5, 2010

Php Script for Check Email open

How to check that send email is open by receiver or not

If we send email use Php mail() function and want that you get information when receiver open that mail or want to keep record of open mail send in mass sending of mail using Php mail() function. To do that we use following code.

$to=""; //email receiver id
$subj=""; // subject of mail
$msg=""; // message that send to receiver
$senderheaders  = "From:\r\n";
$senderheaders .= "Content-type: text/html\r\n";
$senderheaders.="<img src=\"$id\" width=\"1\" height=\"1\" />";


In above code we send image of 1*1px with the header of the mail. when receiver open that mail that will send back to tracking file of sender site and tell them that email is check by receiver.

Monday, May 3, 2010

Integration of CCAVENUE Payment gateway

Integration of CCAVENUE Payment Cart in Your Shopping Section 

CCavenue is most popular Payment gateway for online Shopping. It provide payment through using International credit card as well using your Bank (who have bond with CCavenue) online Account or using it's debit card(ATM card). It is one of the most secure place for given your money to online shop.

For Integrate it with your website you should have ccavenue account and they give you a merchant id and a unique key for your site that is most important for money transaction.

Php Function's Require TO Validate Require Value for CCAvenue Payment.


function getchecksum($MerchantId,$Amount,$OrderId ,$URL,$WorkingKey)
  $str ="$MerchantId|$OrderId|$Amount|$URL|$WorkingKey";
  $adler = 1;
  $adler = adler32($adler,$str);
  return $adler;

function verifychecksum($MerchantId,$OrderId,$Amount,$AuthDesc,$CheckSum,$WorkingKey)
  $str = "$MerchantId|$OrderId|$Amount|$AuthDesc|$WorkingKey";
  $adler = 1;
  $adler = adler32($adler,$str);

  if($adler == $CheckSum)
  return "true" ;
  return "false" ;

function adler32($adler , $str)
  $BASE =  65521 ;

$s1 = $adler & 0xffff ;
  $s2 = ($adler >> 16) & 0xffff;
  for($i = 0 ; $i < strlen($str) ; $i++)
  $s1 = ($s1 + Ord($str[$i])) % $BASE ;
  $s2 = ($s2 + $s1) % $BASE ;
  //echo "s1 : $s1 <BR> s2 : $s2 <BR>";

  return leftshift($s2 , 16) + $s1;

function leftshift($str , $num)

$str = DecBin($str);

for( $i = 0 ; $i < (64 - strlen($str)) ; $i++)
  $str = "0".$str ;

for($i = 0 ; $i < $num ; $i++)
  $str = $str."0";
  $str = substr($str , 1 ) ;
  //echo "str : $str <BR>";
  return cdec($str) ;

function cdec($num)

for ($n = 0 ; $n < strlen($num) ; $n++)
  $temp = $num[$n] ;
  $dec =  $dec + $temp*pow(2 , strlen($num) - $n - 1);

return $dec;

CCAvenue Passing Parameter That Require for Complete the Shopping

    $Merchant_Id = "";//This id(also User Id)  available at "Generate Working Key" of "Settings & Options"
    $Amount = $orderdata[5];//your script should substitute the amount in the quotes provided here
    $Order_Id = $orderdata[0];;//your script should substitute the order description in the quotes provided here
    $WorkingKey = "";//Given to merchant by ccavenue
    $Redirect_Url ="";
    $Checksum = getCheckSum($Merchant_Id,$Amount,$Order_Id ,$Redirect_Url,$WorkingKey); // Validate All value
<p align="center" style="font-family:Calibri; font-size:18px;"><img src="" alt="loader"></p>
<p align="center" style="font-family:Calibri; font-size:24px;color:#3670A7;">Processing to CCAvenue..............</p>
<form id="form2" method="post" action="">
<input type=hidden name=Merchant_Id value="<?php echo $Merchant_Id; ?>">
<input type="hidden" name="Amount" value="<?php echo $Amount; ?>">
<input type="hidden" name="Order_Id" value="<?php echo $Order_Id; ?>">
<input type="hidden" name="Redirect_Url" value="<?php echo $Redirect_Url; ?>">
<input type="hidden" name="Checksum" value="<?php echo $Checksum; ?>">
<input type="hidden" name="billing_cust_name" value="<?= $orderdata[7].' '.$orderdata[8];?>"> <!--Pass Customer Full Name -->
<input type="hidden" name="billing_cust_address" value="<?= $orderdata[9].' '.$orderdata[10];?>"><!--Pass Customer Full Address-->
<input type="hidden" name="billing_cust_country" value="<?= $orderdata[15];?>"> <!--Pass Customer Country -->
<input type="hidden" name="billing_cust_state" value="<?= $orderdata[14];?>"><!--Pass Customer State -->
<input type="hidden" name="billing_cust_city" value="<?= $orderdata[13];?>"> <!--Pass Customer City -->
<input type="hidden" name="billing_zip" value="<?= $orderdata[16];?>"> <!--Pass Customer Zip Code-->
<input type="hidden" name="billing_cust_tel" value="<?= $orderdata[11];?>"> <!--Pass Customer Phone No-->
<input type="hidden" name="billing_cust_email" value="<?= $orderdata[12];?>"> <!--Pass Customer Email address-->
<input type="hidden" name="delivery_cust_name" value="<?= $orderdata[7].' '.$orderdata[8];?>"> <!--Pass Same or other other detail fill by customer-->
<input type="hidden" name="delivery_cust_address" value="<?= $orderdata[9].' '.$orderdata[10];?>">
<input type="hidden" name="delivery_cust_country" value="<?= $orderdata[15];?>">
<input type="hidden" name="delivery_cust_state" value="<?= $orderdata[14];?>">
<input type="hidden" name="delivery_cust_tel" value="<?= $orderdata[11];?>">
<input type="hidden" name="delivery_cust_notes" value="">
<input type="hidden" name="Merchant_Param" value="">
<input type="hidden" name="billing_zip_code" value="<?= $orderdata[16];?>">
<input type="hidden" name="delivery_cust_city" value="<?= $orderdata[13];?>">
<input type="hidden" name="delivery_zip_code" value="<?= $orderdata[16];?>">