Posts

array pagination using php class

<?php   class pagination   {     var $page = 1; // Current Page     var $perPage = 10; // Items on each page, defaulted to 10     var $showFirstAndLast = false; // if you would like the first and last page options.         function generate($array, $perPage = 10)     {       // Assign the items per page variable       if (!empty($perPage))         $this->perPage = $perPage;             // Assign the page variable       if (!empty($_GET['page'])) {         $this->page = $_GET['page']; // using the get method       } else {         $this->page = 1; // if we don't have a page number then assume we are on the first page  ...

Steps for installation of fonts on Windows 2008 Server and Tomcat Application Sever.

Image
Windows 2008 Server 1.        Look for the folder named “Fonts” in your windows folder. Most probable it will be “ C:\Windows\Fonts\ ”. Fonts folder can also be find using by running the command “ %windir%/fonts ”. 2.        Copy the required font in the above mention “Fonts” folder. Tomcat Application Sever 1.        Copy the required fonts on tomcat’s JRE inside {JRE_HOME}/lib/fonts/. Step for finding Tomcat JRE Path 1.        Go to the apache home directory (Apache Software Foundation\Tomcat 6.0\logs\service-install.log). it’s can also be find search this file service-install.log in c drive. 2.        Then open the file and check jvm path just like (bin\Tomcat5.exe" --Jvm " C:\Program Files\Java\jre7\ bin\client\jvm.dll"). this is your java home directory “ C:\Program Files\Java\jre7\ ” 3.        Find pat...

how to slider bar open using jquery

-----------------------------------------------------------------------------------------------  <script type="text/javascript" src="<?php bloginfo( 'template_url' ); ?>/js/jquery.min.js"></script> <script type="text/javascript">     $(document).ready(function(){         jQuery(".pull_feedback").toggle(function(){                 jQuery("#feedback").animate({left:"0px"});                 return false;             },             function(){                 jQuery("#feedback").animate({left:"-527px"});                   return false;          ...

javascrpt captcha

<html> <head> <title>Captcha</title>         <script type="text/javascript">    //Created / Generates the captcha function        function DrawCaptcha()     {        var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";        var string_length =6;        var randomstring = '';     for (var i=0; i<string_length; i++) {         var rnum = Math.floor(Math.random() * chars.length);         randomstring += chars.substring(rnum,rnum+1);           }                document.getElementById("txtCaptcha").value = randomstring     }     // Validate the Entered input aganist ...

how to sorting multiple array object in php

sorting multiple array object using php  function sort_arr_of_obj($array, $sortby, $direction='asc') {          $sortedArr = array();     $tmp_Array = array();          foreach($array as $k => $v) {         $tmp_Array[] = strtolower($v->$sortby);     }          if($direction=='asc'){         asort($tmp_Array);     }else{         arsort($tmp_Array);     }          foreach($tmp_Array as $k=>$tmp){         $sortedArr[] = $array[$k];     }          return $sortedArr; } $lowestsellerpricesort= sort_arr_of_obj($response->categories->category->items->product->offers->offer,'baseP...

how to sort multiple array in php

multiple array sorting using php  <?php $multiArray = Array(     Array("id" => 1, "name" => "Defg","add"=>"adstes"),     Array("id" => 4, "name" => "Abcd","add"=>"tes"),     Array("id" => 3, "name" => "Bcde","add"=>"des"),     Array("id" => 2, "name" => "Cdef","add"=>"cad")); function aasort (&$array, $key) {     $sorter=array();     $ret=array();     reset($array);     foreach ($array as $ii => $va) {         $sorter[$ii]=$va[$key];     }     asort($sorter);     foreach ($sorter as $ii => $va) {         $ret[$ii]=$array[$ii];     }     $array=$ret; } aasort($multiArray,"id"); echo "<pre>";print_r($multiArray); ?> multiple array sorting using php

Soap and Rest Example

SOAP Pros: ·          Langauge, platform, and transport agnostic ·          Designed to handle distributed computing environments ·          Is the prevailing standard for web services, and hence has better support from other standards (WSDL, WS-*) and tooling from vendors ·          Built-in error handling (faults) ·          Extensibility Cons: ·          Conceptually more difficult, more "heavy-weight" than REST ·          More verbose ·          Harder to develop, requires tools REST Pros: ·          Language and platform agnostic ·          Much ...