Thursday, February 16, 2012

LibertyReserve Integration,

LibertyReserve Integration
Add Form in your page



<form action="https://sci.libertyreserve.com/en" method="POST">
<input type="hidden" name="lr_acc" value="U1297014">
<input type="hidden" name="lr_store" value="Perfect Money">
<input type="hidden" name="lr_currency" value="LRUSD">
<input type="hidden" name="lr_success_url" value="http://www.demii.com/demo/xchanger/lr_done.php">
<input type="hidden" name="lr_success_url_method" value="POST">
<input type="hidden" name="lr_fail_url" value="http://www.demii.com/demo/xchanger">
<input type="hidden" name="lr_fail_url_method" value="GET">
<input type="hidden" name="secret" value="02135">
<input type="hidden" name="username" value="zohaib">
<input type="hidden" name="port" value="25">
<input type="submit" />
</form>

Saturday, February 4, 2012

Currency converter for php

  1. Create html element for calling ajax function
  2. create currency.js and add code
    1. function currency(amount){

       //Get all the values

       var from = "USD";
       var to = $('#convert').val();

       //Make data string
       var dataString = "amount=" + amount + "&from=" + from + "&to=" + to;

       $.ajax({
       type: "POST",
       url: "ajax_converter.php",
       data: dataString,

       success: function(data){
       //Show results div
       $('#results').hide();

       //Put received response into result div
       $('#results').html(data);
          if(document.getElementById('currency_converter_result'))
          {
                  $('#results').html($('#currency_converter_result').find('span').html());
                  $('#results').show();
          }
       }

       });
       };
  3. create ajax_converter.php for calling api
    1. $amount = $_POST['amount'];
      $from =$_POST['from'];
      $to = $_POST['to'];
      //make string to be put in API
      $string = $amount.$from."=?".$to;

      //Call Google API
      //$google_url = "http://www.google.com/ig/calculator?hl=en&q=".$string;
      $google_url = "http://www.google.com/finance/converter?a=".$amount."&from=USD&to=".$to."";


      //Get and Store API results into a variable
      //$result = file_get_contents($google_url);
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $google_url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch,  CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
      curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
      $result = curl_exec ($ch);
      curl_close ($ch);
             
      var_dump($result);


enjoy :D

Thursday, October 6, 2011

Accessing static property JCache::$_handler as non static in C:\xampp\htdocs\Myschool\libraries\joomla\cache\cache.php on line 420

You have to make a few modification in php.ini, look for "error_reporting = E_ALL | E_STRICT" and remove value "E_ALL | E_STRICT", should look like "error_reporting = " (without quotes) then restart server
enjoy

Tuesday, October 4, 2011

Warning: session_start(): Cannot send session cache limiter - headers already sent ...


this kind of errors would occur, when the encoding of your script file needs to send some headers just after your script starts to execute,

this happens mostly with the scripts using normal utf8 encoding.

To overcome the issue, use utf8(without BOM) encoding provided by notepad++ and most modern editors. Using utf8 encoding and cookie based sessions, will result in headers already sent by error.

Sunday, April 3, 2011

JCalender provide a facility to integrate Calender component with your Swing application
Download this Component from https://sourceforge.net/projects/jcalender/


JCalender Configration with swing application
·                     Click Tools in the netbeans menu
·                     Select a Palette
·                     Swing /AWT Components
·                     Palette Manager Dialog apper
·                     Select a Beans
·                     Click Add from JAR
·                     Choose a JCalender.jar
·                     After adding a jar
·                     Drag a component in your form located in Beans(Downward of all control)

FOR OTHER CONTACT
MZOHAIB91@YAHOO.COM