<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6972890547425817909</id><updated>2024-08-30T17:25:25.618+05:30</updated><category term="Hacking"/><category term="PHP"/><category term="AWS"/><category term="Android"/><category term="Apache installation"/><category term="Archive"/><category term="CALL_USER_FUNC"/><category term="CAS"/><category term="Cakephp"/><category term="Coordova"/><category term="DKIM"/><category term="Google Maps"/><category term="IMAP"/><category term="IOS ANDROID"/><category term="Javascript"/><category term="Markers"/><category term="Phonegap"/><category term="Spyware"/><category term="Sql injection"/><category term="Vtiger"/><category term="create instance"/><category term="facebook"/><category term="firefox addon"/><category term="hacking tool"/><category term="hacking tools"/><category term="linux"/><category term="network scanners"/><category term="nmap"/><category term="stdclassobject"/><category term="tamper data"/><category term="timer"/><category term="tutorials"/><title type='text'>Devi Techno Solutions Official Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-2996147012157012701</id><published>2015-02-24T21:54:00.000+05:30</published><updated>2015-02-26T11:50:28.258+05:30</updated><title type='text'>How to send an SMS in hebrew or any other language other than english with clickatell in vtiger</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today we had to modify vtiger to allow users to send sms in language other than english, after lot of research we were able to get this done&lt;br /&gt;
&lt;br /&gt;
When sending sms through clickatell, you need to convert the message string to a UNICODE characters before submitting to the gateway. Because clickatell has its own unicode convertor. &lt;br /&gt;
&lt;br /&gt;
So we added following function to modules/SMSNotifier/providers/clickatell.php&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function hex_chars($data){
    $mb_hex = &#39;&#39;;
    for($i = 0 ; $i&amp;lt;mb_strlen($data,&#39;UTF-8&#39;) ; $i++){
        $c = mb_substr($data,$i,1,&#39;UTF-8&#39;);
        $o = unpack(&#39;N&#39;,mb_convert_encoding($c,&#39;UCS-4BE&#39;,&#39;UTF-8&#39;));
        $mb_hex .= sprintf(&#39;%04X&#39;,$o[1]);
    }
    return $mb_hex;
} 
&lt;/pre&gt;
&lt;br /&gt;
then converted the message string passed in send function as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$params[&#39;text&#39;] = $this-&amp;gt;hex_chars($message);
&lt;/pre&gt;
&lt;br /&gt;
you also have to pass unicode parameter to your message as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$params[&#39;unicode&#39;] = 1;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/2996147012157012701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2015/02/how-to-send-sms-in-hebrew-or-any-other.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/2996147012157012701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/2996147012157012701'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2015/02/how-to-send-sms-in-hebrew-or-any-other.html' title='How to send an SMS in hebrew or any other language other than english with clickatell in vtiger'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-4493735883799826973</id><published>2014-12-25T11:32:00.001+05:30</published><updated>2015-01-07T18:37:16.892+05:30</updated><title type='text'>Enable Jquery Tooltip for Click Event Only</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Let us say we have a div element as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div title = &quot;jQuery Tooltip on Click&quot; id = &quot;tooltip&quot; &amp;gt; jQuery Tooltip on Click &amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
you can use below mentioned script to enable jquery tooltip only on click&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;jQuery(&quot;document&quot;).ready(function(){ 

    $(&#39;#tooltip&#39;).tooltip({disabled: true}).on(&quot;click&quot;, function() { 
     
     if($(&quot;#tooltip&quot;).hasClass(&quot;opentooltip&quot;)){ 
      
      $(&quot;#tooltip&quot;).tooltip(&quot;close&quot;); 
      
      $(&quot;#tooltip&quot;).removeClass(&quot;opentooltip&quot;); 
     
     } else {
      
      $(&quot;#tooltip&quot;).addClass(&quot;opentooltip&quot;); 
      
      $(this).tooltip(&quot;enable&quot;).tooltip(&quot;open&quot;).off(&quot;mouseover mouseout mouseleave&quot;);
      
     }
     
    });
    // Disable Default MouseOver Behavior for Div
    $(&quot;#tooltip&quot;).hover(function(e){ e.preventDefault(); });
    
   });

&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/4493735883799826973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2014/12/enable-jquery-tooltip-for-click-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4493735883799826973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4493735883799826973'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2014/12/enable-jquery-tooltip-for-click-event.html' title='Enable Jquery Tooltip for Click Event Only'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-1618324989870677559</id><published>2014-07-05T17:53:00.001+05:30</published><updated>2015-01-07T22:20:47.271+05:30</updated><title type='text'>Sample Code to Perform Insert, Update and Read Operation on Lead Module of Zoho through Zoho API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Before using, sign up for Zoho CRM &lt;a href=&quot;http://crm.zoho.com/&quot;&gt;Zoho Sign UP&lt;/a&gt; and set your zoho credentials&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

 $username = &quot;&lt;set here=&quot;&quot; username=&quot;&quot;&gt;&quot;;
 $password = &quot;&lt;set here=&quot;&quot; password=&quot;&quot;&gt;&quot;;
 $param = &quot;SCOPE=ZohoCRM/crmapi&amp;amp;EMAIL_ID=&quot;.$username.&quot;&amp;amp;PASSWORD=&quot;.$password;
 
 $ch = curl_init(&quot;https://accounts.zoho.com/apiauthtoken/nb/create&quot;);
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
 $result = curl_exec($ch);
 
 $anArray = explode(&quot;\n&quot;,$result);
 $authToken = explode(&quot;=&quot;,$anArray[&#39;2&#39;]);

 curl_close($ch);
 &lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
 $param = &quot;authtoken=&quot;.$authToken[&#39;1&#39;].&quot;&amp;amp;scope=crmapi&amp;amp;newFormat=1&amp;amp;xmlData=&quot;;
 
 $param .= &#39;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&amp;lt;Leads&amp;gt;&amp;lt;row no=&quot;1&quot;&amp;gt;&amp;lt;FL val=&quot;Lead Source&quot;&amp;gt;Web Download&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Company&quot;&amp;gt;Your Company&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;First Name&quot;&amp;gt;Hannah&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Last Name&quot;&amp;gt;Smith&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Email&quot;&amp;gt;testing@testing.com&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Title&quot;&amp;gt;Manager&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Phone&quot;&amp;gt;1234567890&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Home Phone&quot;&amp;gt;0987654321&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Other Phone&quot;&amp;gt;1212211212&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Fax&quot;&amp;gt;02927272626&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Mobile&quot;&amp;gt;292827622&amp;lt;/FL&amp;gt;&amp;lt;/row&amp;gt;&amp;lt;/Leads&amp;gt;&#39;;
 
 $ch = curl_init(&quot;https://crm.zoho.com/crm/private/json/Leads/insertRecords&quot;);
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
 $result = curl_exec($ch);
 
 $result = json_decode($result, true);
 
 $recordId = $result[&#39;response&#39;][&#39;result&#39;][&#39;recorddetail&#39;][&#39;FL&#39;][0][&#39;content&#39;];
 
 $param = &quot;authtoken=&quot;.$authToken[&#39;1&#39;].&quot;&amp;amp;scope=crmapi&amp;amp;id=$recordId&amp;amp;xmlData=&quot;;
 
 $param .= &#39;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&amp;lt;Leads&amp;gt;&amp;lt;row no=&quot;1&quot;&amp;gt;&amp;lt;FL val=&quot;Lead Source&quot;&amp;gt;Web Download&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Company&quot;&amp;gt;Your Company&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;First Name&quot;&amp;gt;Hannah&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Last Name&quot;&amp;gt;Smith&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Email&quot;&amp;gt;manish@devitechnosolutions.com&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Title&quot;&amp;gt;Manager&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Phone&quot;&amp;gt;1234567890&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Home Phone&quot;&amp;gt;0987654321&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Other Phone&quot;&amp;gt;1212211212&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Fax&quot;&amp;gt;02927272626&amp;lt;/FL&amp;gt;&amp;lt;FL val=&quot;Mobile&quot;&amp;gt;292827622&amp;lt;/FL&amp;gt;&amp;lt;/row&amp;gt;&amp;lt;/Leads&amp;gt;&#39;;
 
 $ch = curl_init(&quot;https://crm.zoho.com/crm/private/json/Leads/updateRecords&quot;);
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
 $result = curl_exec($ch);
 
 $param = &quot;newFormat=1&amp;amp;authtoken=&quot;.$authToken[&#39;1&#39;].&quot;&amp;amp;scope=crmapi&quot;;
 
 $ch = curl_init(&quot;https://crm.zoho.com/crm/private/json/Leads/getRecords&quot;);
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
 $result = curl_exec($ch);
 
 print_r($result);

 
?&amp;gt;&lt;/set&gt;&lt;/set&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/1618324989870677559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2014/07/sample-code-to-perform-insert-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1618324989870677559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1618324989870677559'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2014/07/sample-code-to-perform-insert-update.html' title='Sample Code to Perform Insert, Update and Read Operation on Lead Module of Zoho through Zoho API'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-4320931468277362383</id><published>2014-07-05T13:27:00.003+05:30</published><updated>2015-01-07T22:20:58.267+05:30</updated><title type='text'>Sample Code to  create Invoice into Quickbooks using Quickbook API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Few days ago, we were working on a project to sync &lt;b&gt;Quickbooks &lt;/b&gt;invoice data with 3rd party application,&lt;br /&gt;
But after writing initial code we were getting error CheckNullResponseAndThrowException - Response Null or Empty everytime, but as such there was no solution available for this problem even on google, so somehow we were able to debug the problem, the problem was with customer id that needs to be passed as a string instead of integer value&lt;br /&gt;
&lt;br /&gt;
So here is sample working code you can use to generate invoice&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php
require_once(&#39;../config.php&#39;);
require_once(PATH_SDK_ROOT . &#39;Core/ServiceContext.php&#39;);
require_once(PATH_SDK_ROOT . &#39;DataService/DataService.php&#39;);
require_once(PATH_SDK_ROOT . &#39;PlatformService/PlatformService.php&#39;);
require_once(PATH_SDK_ROOT . &#39;Utility/Configuration/ConfigurationManager.php&#39;);

//Specify QBO or QBD
$serviceType = IntuitServicesType::QBO;

// Please set your own config values
$accessToken = &#39;NULL&#39;;
$accessTokenSecret = &#39;NULL&#39;;
$consumerKey = &#39;NULL&#39;;
$consumerSecret = &#39;NULL&#39;;
$realmId = &#39;NULL&#39;;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;


$requestValidator = new OAuthRequestValidator($accessToken, $accessTokenSecret, $consumerKey, $consumerSecret);

$serviceContext = new ServiceContext($realmId, $serviceType, $requestValidator);

if (!$serviceContext)
 exit(&quot;Problem while initializing ServiceContext.\n&quot;);

// Prep Data Services

$dataService = new DataService($serviceContext);

if (!$dataService)
 exit(&quot;Problem while initializing DataService.\n&quot;);
    
//create an invoice
$invoiceObj = new IPPInvoice();

$Line = new IPPline();
$Line-&amp;gt;Amount = 15;
$Line-&amp;gt;DetailType = &#39;SalesItemLineDetail&#39;;
 
$saleItemLineDetail = new IPPSalesItemLineDetail();
$saleItemLineDetail-&amp;gt;ItemRef = 1;
$Line-&amp;gt;SalesItemLineDetail = $saleItemLineDetail;

$invoiceObj-&amp;gt;Line = $Line;
$invoiceObj-&amp;gt;CustomerRef = 8;

try{
 $resultingInvoiceObj = $dataService-&amp;gt;Add($invoiceObj);
 print_r($resultingInvoiceObj); 
} catch (Exception $e){
 echo $e-&amp;gt;getMessage();
}



?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/4320931468277362383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2014/07/sample-code-to-create-invoice-into.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4320931468277362383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4320931468277362383'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2014/07/sample-code-to-create-invoice-into.html' title='Sample Code to  create Invoice into Quickbooks using Quickbook API'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-5375355484288927598</id><published>2014-06-20T13:24:00.002+05:30</published><updated>2015-01-07T22:21:09.176+05:30</updated><title type='text'>Increase Default Logout time of Vtiger</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Today one of our client asked us to increase default Logout time of Vtiger, so here is a small chunk of code that you can add to increase it yourself&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Open config.inc.php in root folder and add following code at top&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ini_set(&quot;session.gc_maxlifetime&quot;, 3600);&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The above code will increase default logout time to 1 Hour&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/5375355484288927598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2014/06/increase-default-logout-time-of-vtiger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/5375355484288927598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/5375355484288927598'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2014/06/increase-default-logout-time-of-vtiger.html' title='Increase Default Logout time of Vtiger'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-9047433163273871565</id><published>2013-12-29T19:22:00.002+05:30</published><updated>2015-01-07T22:21:21.282+05:30</updated><title type='text'>Tiny MCE: Spell checker not working</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Last week one of my client discovered the spellchecker feature of &lt;b&gt;Tiny MCE&lt;/b&gt; was not working.. After quite a bit of research, we found that this feature uses the Google Spellcheck RPC by default, that makes a call to https://www.google.com/tbproxy/spell?lang=en&amp;amp;hl=en, but now Google appears to have discontinued access to this feature without notice.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Tiny MCE have other options, but they require &lt;b&gt;phpspell&lt;/b&gt; to be installed on server, which further requires ssh (terminal access) in order to install, &amp;nbsp;but due to our limitations with shared hosting, we were not able to install it, so after a lot of search. we found an alternative in the form of &lt;b&gt;After the Deadline&lt;/b&gt; plugin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;You can download this plugin from &lt;a href=&quot;https://github.com/Automattic/atd-tinymce&quot;&gt;Here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Installation instructions are explained very well in the above link, also the plugin works very well.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/9047433163273871565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/12/tiny-mce-spell-checker-not-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/9047433163273871565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/9047433163273871565'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/12/tiny-mce-spell-checker-not-working.html' title='Tiny MCE: Spell checker not working'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-4224641183204825566</id><published>2013-10-13T22:32:00.001+05:30</published><updated>2015-01-07T22:21:32.435+05:30</updated><title type='text'>Improve your Website Loading Time through Apache Booster</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div&gt;Since last few weeks, I &amp;nbsp;was researching on &quot;How to optimize websites to improve their loading time&quot;, &amp;nbsp;because I had great issues with my own personal website (http://devitechnosolutions.com), I had never received more than 60% rating from&amp;nbsp;&lt;a href=&quot;http://gtmetrix.com/&quot;&gt;GtMetrix&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;But Yesterday, I found one way, through Apache booster installed on my Website&#39;s Server&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;It improved my website load time to an extent, that now it is around 92%&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;So if you want to use it, then simply run following commands on your linux machine&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;wget http://prajith.in/downloads/apachebooster-v1.3.tar.gz&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;tar -zxf apachebooster-v1.3.tar.gz&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;cd apachebooster&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;sh install.sh&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Please note this requires root access on your server, these steps won&#39;t work on shared hosting&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/4224641183204825566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/10/improve-your-website-loading-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4224641183204825566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4224641183204825566'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/10/improve-your-website-loading-time.html' title='Improve your Website Loading Time through Apache Booster'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-3109409221505898463</id><published>2013-09-16T23:27:00.000+05:30</published><updated>2015-01-07T22:21:48.801+05:30</updated><title type='text'>adf.fly urls not loading in India</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;From 13th June Adf.ly is blocked in India as per by the order of&amp;nbsp;Department of Telecom&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;line-height: 25.59375px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;To Solve this Problem, use this very simple and effective trick&lt;/span&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;Replace&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;http://&lt;/b&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;&amp;nbsp;by&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;https://&lt;/b&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;Example&lt;/b&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;adf.ly/VYR7U&amp;nbsp;to&lt;/span&gt;&lt;/span&gt;&lt;b style=&quot;background-color: white; line-height: 20px;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;b&gt;https://adf.ly/VYR7U&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/3109409221505898463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/09/adffly-urls-not-loading-in-india.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3109409221505898463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3109409221505898463'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/09/adffly-urls-not-loading-in-india.html' title='adf.fly urls not loading in India'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-4296952397117081414</id><published>2013-09-15T23:28:00.002+05:30</published><updated>2015-01-07T22:22:01.278+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Archive"/><category scheme="http://www.blogger.com/atom/ns#" term="Cakephp"/><title type='text'>Implement Archive feature in Cakephp</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;background-color: white; line-height: 25px; margin-bottom: 10px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Many times when we create a web application, generally we require a very common feature that is very similar to window&#39;s recycle bin. In terms of Web Application we also call it Archive which basically means mark the record as delete but not physically.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Last week while working on a web project, I had to implement this feature in my cakephp Application that was really easy to implement using small few steps.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Using below mentioned Steps you can add this feature in your application&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;background-color: white; line-height: 25px; margin: 0px 0px 10px 25px; padding: 0px;&quot;&gt;&lt;li style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create two fields&amp;nbsp;&lt;span style=&quot;line-height: 25px;&quot;&gt;&amp;nbsp;&quot;deleted&quot; and &quot;deleted_date&quot; fields on your database table.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Download and copy this behavior to app/Model/Behavior.&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; line-height: 25px;&quot;&gt;There are ready made&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Arial, Helvetica, sans-serif; line-height: 25px;&quot;&gt;Cakephp&lt;/b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; line-height: 25px;&quot;&gt;&amp;nbsp;based behaviors available, that can be used, &amp;nbsp;but I had used CakeDC Utils SoftDelete Behavior.&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://github.com/CakeDC/utils/blob/master/Model/Behavior/SoftDeleteBehavior.php&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; line-height: 25px;&quot;&gt;Click Here&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; line-height: 25px;&quot;&gt;&amp;nbsp;&amp;nbsp;to Download it.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul style=&quot;background-color: white; line-height: 25px; margin: 0px 0px 10px 25px; padding: 0px;&quot;&gt;&lt;li style=&quot;line-height: 20px;&quot;&gt; &lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Add the behavior to the $actsAs member of the model&lt;/span&gt;&lt;/li&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;class User extends AppModel {
var $actsAs = array(&#39;SoftDeletable&#39;);
}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;/pre&gt;&lt;/ul&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial, Helvetica, sans-serif; line-height: 20px;&quot;&gt;Now whenever you perform a delete action on any record, then it won’t delete that record&amp;nbsp;permanently and you can always retain that record&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/4296952397117081414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/09/implement-archive-feature-in-cakephp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4296952397117081414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/4296952397117081414'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/09/implement-archive-feature-in-cakephp.html' title='Implement Archive feature in Cakephp'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-7840873584429663514</id><published>2013-07-07T13:17:00.000+05:30</published><updated>2015-01-07T22:22:27.709+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="IMAP"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Forward email to a predefined email address using PHP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
Few days ago, I was looking for a script for my CRM (&lt;b&gt;Customer Relationship Management&lt;/b&gt;) software that will simply forward all the emails received at a common address to their respective sales agent.&lt;br /&gt;
&lt;br /&gt;
After few hrs I had successfully managed to write this script using PHP&lt;br /&gt;
&lt;br /&gt;
In this script i am using &lt;b&gt;&lt;a href=&quot;http://phpmailer.worxware.com/&quot;&gt;PHPMAILER&lt;/a&gt;&lt;/b&gt; class in order to send emails and imap utility to fetch and read emails&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php
 
/*  
    Author:Devi Techno Solutions
    Email : manish@devitechnosolutions.com
*/

require_once(&#39;class.phpmailer.php&#39;);

/* connect to Mailer Server to Read Emails */
$inbox = imap_open($imap_host_name,$imap_user_name,$imap_password) or die(&#39;Cannot connect to IMAP: &#39; . imap_last_error());

// Connect with SMTP to Send Emails
$mail = new PHPMailer();
$mail-&amp;gt;IsSMTP(); 
$mail-&amp;gt;SMTPDebug  = 0;
$mail-&amp;gt;SMTPAuth   = true;
$mail-&amp;gt;Host  = $smtp_host;

// Change these settings according to needs
$mail-&amp;gt;Port  = $smtp_port;  
$mail-&amp;gt;SMTPSecure = &quot;ssl&quot;;

$mail-&amp;gt;Username  = $smtp_username; 
$mail-&amp;gt;Password  = $smtp_password;  

//Read all the Emails
$emails = imap_search($inbox,&#39;UNSEEN&#39;);

if($emails) {
 
 rsort($emails);
 
 foreach($emails as $email_number) {
  
  $overview = imap_fetch_overview($inbox,$email_number,0);
  $message = imap_fetchbody($inbox,$email_number,1.2);
  $structure = imap_fetchstructure($inbox,$email_number);
  $header = imap_headerinfo($inbox, $email_number);
  
  $attachments = array();
  
  if(isset($structure-&amp;gt;parts) &amp;amp;&amp;amp; count($structure-&amp;gt;parts)) {
   
   for($i = 0; $i &amp;lt; count($structure-&amp;gt;parts); $i++) {
    
    $attachments[$i] = array(
      &#39;is_attachment&#39; =&amp;gt; false,
      &#39;filename&#39; =&amp;gt; &#39;&#39;,
      &#39;name&#39; =&amp;gt; &#39;&#39;,
      &#39;attachment&#39; =&amp;gt; &#39;&#39;
     );
    
    if($structure-&amp;gt;parts[$i]-&amp;gt;ifdparameters) {
     foreach($structure-&amp;gt;parts[$i]-&amp;gt;dparameters as $object) {
      if(strtolower($object-&amp;gt;attribute) == &#39;filename&#39;) {
       $attachments[$i][&#39;is_attachment&#39;] = true;
       $attachments[$i][&#39;filename&#39;] = $object-&amp;gt;value;
      }
     }
    }

    if($structure-&amp;gt;parts[$i]-&amp;gt;ifparameters) {
     foreach($structure-&amp;gt;parts[$i]-&amp;gt;parameters as $object) {
      if(strtolower($object-&amp;gt;attribute) == &#39;name&#39;) {
       $attachments[$i][&#39;is_attachment&#39;] = true;
       $attachments[$i][&#39;name&#39;] = $object-&amp;gt;value;
      }
     }
    }
    
    if($attachments[$i][&#39;is_attachment&#39;]) {
     $attachments[$i][&#39;attachment&#39;] = imap_fetchbody($inbox, $email_number, $i+1);
     if($structure-&amp;gt;parts[$i]-&amp;gt;encoding == 3) { // 3 = BASE64
      $attachments[$i][&#39;attachment&#39;] = base64_decode($attachments[$i][&#39;attachment&#39;]);
     } elseif($structure-&amp;gt;parts[$i]-&amp;gt;encoding == 4) { // 4 = QUOTED-PRINTABLE
      $attachments[$i][&#39;attachment&#39;] = quoted_printable_decode($attachments[$i][&#39;attachment&#39;]);
     }
    }
   } 
  } 
  
  $file_attachments = array();
  if(count($attachments) != 0){
   foreach($attachments as $at){
    if($at[is_attachment]==1){
     $fname = $at[&#39;filename&#39;];
     $file_attachments[] = &quot;attachments/$fname&quot;;
     $fp = fopen(&quot;attachments/$fname&quot;,&quot;w&quot;);
     fwrite($fp, $at[&#39;attachment&#39;]);
     fclose($fp);
    }
            }
  }
  
  $subject = $overview[0]-&amp;gt;subject;
  $from = $overview[0]-&amp;gt;from;
  $fromEmail = $header-&amp;gt;from[0]-&amp;gt;mailbox . &quot;@&quot; . $header-&amp;gt;from[0]-&amp;gt;host;
  
  $mail-&amp;gt;SetFrom($fromEmail, $from);
  $mail-&amp;gt;Subject  = $subject;
  $body = $message;
  $mail-&amp;gt;MsgHTML($body);
  
  $mail-&amp;gt;AddAddress($recepeint_email_address, $recepeint_name);
  if(!empty($file_attachments)){
   foreach($file_attachments as $file){
    $mail-&amp;gt;AddAttachment($file);
   }
  }
  $mail-&amp;gt;Send();
 }
} 

?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Replace the following variables with their respective values&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$imap_host_name = &#39;{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX&#39;; // eg &#39;{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX&#39;;
 $imap_user_name = &#39;&#39;;
 $imap_password = &#39;&#39;; 
 
 $smtp_host = &#39;smtp.gmail.com&#39;;
 $smtp_username = &#39;&#39;;
 $smtp_password = &#39;&#39;;
 $smtp_port = &#39;465&#39;;
 
 
 $recepeint_email_address = &#39;goyalmanish47@gmail.com&#39;;
 $recepeint_name = &#39;Manish Goyal&#39;;
&lt;/pre&gt;&lt;br /&gt;
Note: When you run this Script, Create a folder named attachment where all the attachments are downloaded and attach to email again&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/7840873584429663514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/07/forward-email-to-predefined-email.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7840873584429663514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7840873584429663514'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/07/forward-email-to-predefined-email.html' title='Forward email to a predefined email address using PHP'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-3006952855307081748</id><published>2013-05-10T17:44:00.001+05:30</published><updated>2015-01-07T22:22:50.204+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="stdclassobject"/><title type='text'>Convert Object array of class stdClass to array in PHP</title><content type='html'>While working with some API to fetch data from 3rd party website, you might have seen that most of these api send data in the form of std class object that is really frustrating for someone who is used to work with array, so with this small chunk of below mentioned code, you can easily convert a std class object to array form.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php
  $result = json_encode($result);
  $result = json_decode($result, true);
?&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
Please post your comments if you find this useful</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/3006952855307081748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/05/convert-object-aray-of-class-stdclass.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3006952855307081748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3006952855307081748'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/05/convert-object-aray-of-class-stdclass.html' title='Convert Object array of class stdClass to array in PHP'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-7401938698319085772</id><published>2013-05-04T16:02:00.000+05:30</published><updated>2015-01-07T22:23:25.981+05:30</updated><title type='text'>Search Facebook Users from your website using Graph API</title><content type='html'>Today through this post of mine, I will describe you How to search a user on &lt;b&gt;Facebook&lt;/b&gt; using it&#39;s graph api from your website&lt;br /&gt;
&lt;br /&gt;
Here we will use simple graph api provided by facebook, For more info refer this url &lt;a href=&quot;http://developers.facebook.com/docs/reference/api/&quot;&gt;Graph API&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We need to pass three parameters to url &quot;https://graph.facebook.com&quot; through which we can search any type of content from a 3rd party website&lt;br /&gt;
&lt;br /&gt;
For eg if you want to search for wall post having content say &quot;watermelon&quot; then I will call url of the following form&lt;br /&gt;
&lt;br /&gt;
https://graph.facebook.com/search?q=watermelon&amp;amp;type=post&lt;br /&gt;
&lt;br /&gt;
Please note that user don&#39;t need to search pass access token to search for post data,but if you want to search for specific user then you have to pass access token&lt;br /&gt;
&lt;br /&gt;
Below is the simple script that you can use to implement this feature on your website&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php
 require &#39;src/facebook.php&#39;;

 $facebook = new Facebook(array(
  &#39;appId&#39;  =&amp;gt; &#39;465199043533380&#39;,
  &#39;secret&#39; =&amp;gt; &#39;611cc4009b15a1d6b00fe5775a1c0d5b&#39;,
 ));

 if(!empty($_POST)){
 
  $user = $facebook-&amp;gt;getUser();
  
  if ($user) {
   $logout_url = $facebook-&amp;gt;getLogoutUrl();
   $response_params = array();
   parse_str($logout_url, $response_params);
   $token = $response_params[&#39;access_token&#39;];
   $email = $_REQUEST[&#39;email&#39;];
   $contents = file_get_contents(&quot;https://graph.facebook.com/?q=$email&amp;amp;type=user&amp;amp;access_token=$token&quot;);
  } else {
   $params = array(&quot;response_type&quot; =&amp;gt; &quot;token&quot;);
   $loginUrl = $facebook-&amp;gt;getLoginUrl();
   header(&quot;location:$loginUrl&quot;);
  }
 
 }

?&amp;gt;
 
&amp;lt;?php
 require &#39;src/facebook.php&#39;;

 $facebook = new Facebook(array(
  &#39;appId&#39;  =&amp;gt; &#39;465199043533380&#39;,
  &#39;secret&#39; =&amp;gt; &#39;611cc4009b15a1d6b00fe5775a1c0d5b&#39;,
 ));

 if(!empty($_POST)){
 
  $user = $facebook-&amp;gt;getUser();
  
  if ($user) {
   $logout_url = $facebook-&amp;gt;getLogoutUrl();
   $response_params = array();
   parse_str($logout_url, $response_params);
   $token = $response_params[&#39;access_token&#39;];
   $email = $_REQUEST[&#39;email&#39;];
   $contents = file_get_contents(&quot;https://graph.facebook.com/?q=$email&amp;amp;type=user&amp;amp;access_token=$token&quot;);
  } else {
   $params = array(&quot;response_type&quot; =&amp;gt; &quot;token&quot;);
   $loginUrl = $facebook-&amp;gt;getLoginUrl();
   header(&quot;location:$loginUrl&quot;);
  }
 }
?&amp;gt;
 &amp;lt;!doctype html&amp;gt;
 &amp;lt;html xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&amp;gt;
  &amp;lt;head&amp;gt;
   &amp;lt;title&amp;gt;Facebook Graph Search&amp;lt;/title&amp;gt;
   &amp;lt;style&amp;gt;
    body {
     font-family: &#39;Lucida Grande&#39;, Verdana, Arial, sans-serif;
    }
    h1 a {
     text-decoration: none;
     color: #3b5998;
    }
    h1 a:hover {
     text-decoration: underline;
    }
   &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
   &amp;lt;table cellpadding = &quot;0&quot;&amp;gt;
    &amp;lt;tr&amp;gt;
     &amp;lt;td&amp;gt;
      &amp;lt;h1&amp;gt;Facebook Graph Search&amp;lt;/h1&amp;gt;
     &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
     &amp;lt;td&amp;gt;
     &amp;lt;form method = &quot;post&quot;&amp;gt;
      &amp;lt;input type = &quot;text&quot; name  = &quot;email&quot;&amp;gt;
      &amp;lt;input type = &quot;submit&quot;&amp;gt;
     &amp;lt;/form&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
     &amp;lt;td&amp;gt;
      &amp;lt;?php 
       if(!empty($contents)){
        print_r($contents);
       }
      ?&amp;gt;
     &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
     
   &amp;lt;/table&amp;gt;
  &amp;lt;/body&amp;gt;
 &amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Download Complete Files from &lt;a href=&quot;http://customer-ratings.in/graph_search_manish.zip&quot;&gt;Here&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/7401938698319085772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/05/search-facebook-users-from-your-website.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7401938698319085772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7401938698319085772'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/05/search-facebook-users-from-your-website.html' title='Search Facebook Users from your website using Graph API'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-5918569647435150955</id><published>2013-04-14T22:16:00.000+05:30</published><updated>2015-01-07T22:23:38.819+05:30</updated><title type='text'>How to create relations between two different module of Vtiger?</title><content type='html'>Few months ago&lt;br /&gt;
&lt;br /&gt;
I was working on project based on vtiger, where I was struggling to create relations between two modules of vtiger (CRM software)&lt;br /&gt;
&lt;br /&gt;
Finally I was able to create a very small but effective script that helped me to create any relation between two module in just few secs&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$Vtiger_Utils_Log = true;
include_once(&#39;vtlib/Vtiger/Menu.php&#39;);
include_once(&#39;vtlib/Vtiger/Module.php&#39;);
// Create module instance and save it first
$salesOrderModule = Vtiger_Module::getInstance(&#39;SalesOrder&#39;);
$projectModule = Vtiger_Module::getInstance(&#39;Project&#39;);
$salesOrderModule-&amp;gt;setRelatedList($projectModule,&#39;Project&#39;,&#39;add,select&#39;);
&lt;/pre&gt;&lt;br /&gt;
Here we just getting instance of two different modules of vtiger and using inbuilt function of vtiger to create relation between two modules, Please note that if you are creating relation between SalesOrder to Project then you will call setRelatedList over salesOrderModule object, else vice versa&lt;br /&gt;
&lt;br /&gt;
If any doubts, feel free to ask me&lt;br /&gt;
&lt;br /&gt;
This post was sponsored by &lt;b&gt;27coupons.com&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/5918569647435150955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/04/how-to-create-relations-between-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/5918569647435150955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/5918569647435150955'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/04/how-to-create-relations-between-two.html' title='How to create relations between two different module of Vtiger?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-172079044629326105</id><published>2013-03-27T14:19:00.001+05:30</published><updated>2015-01-07T22:23:52.758+05:30</updated><title type='text'>How to add  File Size Validation through Jquery?</title><content type='html'>Few days ago, I was struggling to add this validation on my website, and after a long search , I was successful in implementing this, Using the following simple script you can add this validation very easily&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;script type = &quot;text/javascript&quot;&amp;gt;
jQuery(&quot;input[type=file]&quot;).live(&quot;change&quot;, function(e){
e.preventDefault();
var file_size = jQuery(this)[0];
if(file_size.files[0].size &amp;gt; 2000000){
alert(&quot;File Size should be  Maximum of 2 mb&quot;);
return false;
}
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The above Script is simply adding a change event on file input type and check for Size of file input type and accordingly show alert message to user&lt;br /&gt;
&lt;br /&gt;
I hope this simple script will help you, If any queries feel free to ask</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/172079044629326105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/03/how-to-check-file-size-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/172079044629326105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/172079044629326105'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/03/how-to-check-file-size-validation.html' title='How to add  File Size Validation through Jquery?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-2954591593497592533</id><published>2013-03-23T16:02:00.000+05:30</published><updated>2015-01-07T22:24:05.722+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Maps"/><category scheme="http://www.blogger.com/atom/ns#" term="Markers"/><title type='text'>How to display multiple markers on google maps?</title><content type='html'>Few months ago, I had a task of integrating &lt;b&gt;Google Maps&lt;/b&gt;, after many attempts, I was successful in implementing it &lt;br /&gt;
&lt;br /&gt;
After following simple steps you can integrate it very easily&lt;br /&gt;
&lt;br /&gt;
First of all, include following scripts in your HTML page&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;script src = &quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;http://maps.google.com/maps/api/js?sensor=false&quot; type=&quot;text/javascript&quot;&amp;gt; &amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now add following tag in your page&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div id = &quot;map_canvas&quot; style = &quot;width:300px;height:300px;&quot;&amp;gt;&amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Now just add following chunk of code&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;script&amp;gt;
$(document).ready(function(){
var location = [{&quot;latitude&quot;:33.82353,&quot;longitude&quot;:-117.9659037,&quot;html&quot;:&quot;1721 W. Katella Ave Ste P Anaheim92804&quot;,&quot;popup&quot;:false},{&quot;latitude&quot;:33.8749591,&quot;longitude&quot;:-117.9659037,&quot;html&quot;:&quot;119 W. Orangethorpe Ave Fullerton92833&quot;,&quot;popup&quot;:false}]  
var map;
var lat = location[0][&quot;latitude&quot;];
var long =  location[0][&quot;longitude&quot;];

var myOptions = {
center: new google.maps.LatLng(lat, long),
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(&quot;map_canvas&quot;), myOptions);
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i &amp;lt; location.length; i++) {     
marker = new google.maps.Marker({position: new google.maps.LatLng(location[i][&quot;latitude&quot;], location[i][&quot;longitude&quot;]), map: map});      google.maps.event.addListener(marker, &#39;click&#39;, (function(marker, i) {        
return function() {           
infowindow.setContent(location[i][&quot;html&quot;]);           
infowindow.open(map, marker);        
}       })(marker, i));   }  }); 
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Note the variable : locations, here you need to pass lat, long explicitly or you can form this json string through your own php code&lt;br /&gt;
&lt;br /&gt;
If still any issues, then feel free to put your queries</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/2954591593497592533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/03/how-to-display-multiple-markers-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/2954591593497592533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/2954591593497592533'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/03/how-to-display-multiple-markers-on.html' title='How to display multiple markers on google maps?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-1836882635972695596</id><published>2013-02-24T13:26:00.004+05:30</published><updated>2015-01-07T22:24:28.173+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Coordova"/><category scheme="http://www.blogger.com/atom/ns#" term="Phonegap"/><title type='text'>How to convert a website compatible for Mobile versions into a working Android application in 15 mins</title><content type='html'>&lt;div&gt;Few days ago,I had to build a Android Based application from a existing website compatible with Mobile versions&lt;/div&gt;&lt;div&gt;So after some research, I was able to find a way through &lt;b&gt;coordova&amp;nbsp;&lt;/b&gt;framework&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;First of all you have to know how to build a basic android application, you can refer below mentioned url for this&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;a href=&quot;http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html&quot;&gt;http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div&gt;Once set up, just add a small change in following file&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;MainActivity.java in your main Application package&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;super.loadUrl(&quot;file:///android_asset/www/index.html&quot;);
to 
super.loadUrl(&quot;http://example.com&quot;);
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;Here example.com is a url of your website, which you want to convert, If you have any doubts, Feel free to ask me&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goyal1989.blogspot.com/feeds/1836882635972695596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goyal1989.blogspot.com/2013/02/how-to-convert-website-compatible-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1836882635972695596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1836882635972695596'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/02/how-to-convert-website-compatible-for.html' title='How to convert a website compatible for Mobile versions into a working Android application in 15 mins'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-7338670588611333261</id><published>2013-02-24T13:05:00.000+05:30</published><updated>2013-04-28T18:56:57.710+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="IOS ANDROID"/><title type='text'>SMSComposer for latest Coordova Versions</title><content type='html'>Few days ago I was working on integration of SMS composer for IOS platform on Coordova&lt;br /&gt;
&lt;br /&gt;
But I had great difficulty in making it work using ready made script available from official coordova plugin&lt;br /&gt;
&lt;br /&gt;
So I had make it work through some minor modifications&lt;br /&gt;
&lt;br /&gt;
Below is the repository URL of working SMS Composer&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/crazygoyal786/SMSComposerIOS&quot;&gt;https://github.com/crazygoyal786/SMSComposerIOS&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to ask any doubts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7338670588611333261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7338670588611333261'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/02/smscomposer-for-latest-coordova-versions.html' title='SMSComposer for latest Coordova Versions'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-1568208529995949907</id><published>2013-01-16T23:24:00.001+05:30</published><updated>2013-01-16T23:25:50.471+05:30</updated><title type='text'>How to Sort Json Array in Chrome and Opera?</title><content type='html'>Last week while working on some bug in a Project, I was badly stuck with some strange issue, that i had never experienced&lt;br /&gt;
&lt;br /&gt;
I had a load drop down value dynamically with new values in alphabetical order, it was working fine in Mozilla and IE but not in Chrome and Opera, the reason being chrome&amp;nbsp;perform&amp;nbsp;it&#39;s internal sorting based id value,&amp;nbsp;doesn&#39;t matter in which order it is coming from&amp;nbsp;back end, so after a long struggle I finally managed to fix it&lt;br /&gt;
&lt;br /&gt;
Below is the simple to which you will pass Json array and it will return sorted array&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
function sortJsonObject(response){&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; var values = [];&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; for(var i in response) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;values.push({ key: i, value: response[i] });&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; return values.sort(function(a, b) { return a.value.localeCompare(b.value); });&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hope this will help you guys&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Thanks&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1568208529995949907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1568208529995949907'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2013/01/how-to-sort-json-array-in-chrome-and.html' title='How to Sort Json Array in Chrome and Opera?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-1404487563332298735</id><published>2012-04-08T12:49:00.002+05:30</published><updated>2013-01-17T10:18:59.838+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CAS"/><category scheme="http://www.blogger.com/atom/ns#" term="Vtiger"/><title type='text'>Integrate Vtiger with CAS</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Few months ago, I had a project, where I had to integrate &lt;b&gt;Vtiger&lt;/b&gt; with &lt;b&gt;CAS&lt;/b&gt; i.e Centralized Authentication Service For more information on &lt;b&gt;CAS&lt;/b&gt;, Please refer this link &lt;b&gt;CAS&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;After long time research, I successfully managed to make it work with &lt;b&gt;Vtiger&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Use following simple steps to integrate it&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Download Php - PEAR class&lt;/b&gt; -&amp;nbsp;&lt;a href=&quot;http://pear.php.net/DB&quot;&gt;Click here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Download CAS module from&lt;/b&gt; - &lt;a href=&quot;http://esup-phpcas.sourceforge.net/&quot;&gt;Here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Edit file: /vtiger530/modules/Users/Authenticate.php&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Replace lines 28-37 &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;global $mod_strings, $default_charset;
$focus = new Users();
// Add in defensive code here.
$focus-&amp;gt;column_fields[&quot;user_name&quot;] = to_html($_REQUEST[&#39;user_name&#39;]);
$user_password = vtlib_purify($_REQUEST[&#39;user_password&#39;]);
$focus-&amp;gt;load_user($user_password);
&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;With following Code(change bold items):&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;global $mod_strings, $default_charset;
require_once(&#39;modules/CAS.php&#39;);
phpCAS::setDebug();
phpCAS::client(CAS_VERSION_2_0,&#39;CAS_SERVER_IP_HERE&#39;,CAS_SERVER_PORT_HERE,&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&#39;CAS_SERVER_WEBFOLDER_HERE&#39;,FALSE);
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
$focus = new Users();
$focus-&amp;gt;column_fields[&quot;user_name&quot;] = phpCAS::getUser();
$user_password = &quot;no_use&quot;;
$focus-&amp;gt;load_user_cas($user_password);
&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Edit file: /vtiger530/modules/Users/Users.php&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Add this function into class User&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;function load_user_cas($user_password) {
 $usr_name = $this-&amp;gt;column_fields[&quot;user_name&quot;];
 if(isset($_SESSION[&#39;loginattempts&#39;])){
  $_SESSION[&#39;loginattempts&#39;] += 1;
 } else{
  $_SESSION[&#39;loginattempts&#39;] = 1;
 }
if($_SESSION[&#39;loginattempts&#39;] &amp;gt; 5){
   $this-&amp;gt;log-&amp;gt;warn(&quot;security: &quot; . $usr_name . &quot; has attempted to login &quot;.&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;$_SESSION[&#39;loginattempts&#39;] . &quot; times.&quot;);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$this-&amp;gt;log-&amp;gt;debug(&quot;starting user load for $usr_name&quot;);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$validation = 0;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;unset($_SESSION[&#39;validation&#39;]);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if( !isset($this-&amp;gt;column_fields[&quot;user_name&quot;]) || $this-&amp;gt;column_fields[&quot;user_name&quot;]&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;== &quot;&quot; || !isset($user_password) || $user_password == &quot;&quot;) return null;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if($this-&amp;gt;validation_check(&#39;aw5jbhvkzs9pbwfnzxmvc3vnyxjzywxlc19tzc5nawy=&#39;,&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&#39;1a44d4ab8f2d&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;6e15e0ff6ac1c2c87e6f&#39;, &#39;866bba5ae0a15180e8613d33b0acc6bd&#39;) == -1)&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;$validation = -1;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &amp;nbsp;&lt;/span&gt;if($this-&amp;gt;validation_check(&#39;aw5jbhvkzs9pbwfnzxmvcg93zxjlzf9iev9zdwdhcmnybs5nawy=&#39;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;,&#39;3d49c9768de467925daabf242fe93cce&#39;) == -1)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $validation = -1;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if($this-&amp;gt;authorization_check(&#39;aw5kzxgucghw&#39; ,&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&#39;peegahjlzj0nahr0cdovl3d3dy5zdwdhcmnybs5jb20nihrhcmdldd0nx2jsyw5rjz48aw&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1nigjvcmrlcj0nmccgc3jjpsdpbmnsdwrll2ltywdlcy9wb3dlcmvkx2j5x3n1z2fyy&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3jtlmdpzicgywx0psdqb3dlcmvkiej5ifn1z2fyq1jnjz48l2e+&#39;, 1)&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;== -1)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $validation = -1;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$encrypted_password = $this-&amp;gt;encrypt_password($user_password);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$authcheck = true;

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(!$authcheck){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;log-&amp;gt;warn(&quot;user authentication for $usr_name failed&quot;);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$query = &quot;select * from $this-&amp;gt;table_name where user_name=&#39;$usr_name&#39;&quot;;

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$result = $this-&amp;gt;db-&amp;gt;requiresingleresult($query, false);

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$row = $this-&amp;gt;db-&amp;gt;fetchbyassoc($result);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;echo $this-&amp;gt;id = $row[&#39;id&#39;];
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$user_hash = strtolower(md5($user_password));

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// if there is no user_hash is not present or is out of date, then create a new one.
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(!isset($row[&#39;user_hash&#39;]) || $row[&#39;user_hash&#39;] != $user_hash){
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $query = &quot;update $this-&amp;gt;table_name set user_hash=&#39;$user_hash&#39; where id=&#39;{$row[&#39;id&#39;]}&#39;&quot;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;db-&amp;gt;query($query, true, &quot;error setting new hash for {$row[&#39;user_name&#39;]}: &quot;);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$this-&amp;gt;loadpreferencesfromdb($row[&#39;user_preferences&#39;]);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if ($row[&#39;status&#39;] != &quot;inactive&quot;)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;authenticated = true;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;unset($_SESSION[&#39;loginattempts&#39;]);
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return $this;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&lt;div&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Till this step, You will be able to able to authenticate your self in CAS, Now we need to validate ticket received from CAS server and prepare session of CAS in order to authenticate user for accessing application&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For this add following line of code , inside index.php in root folder&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;If(isset($_GET[‘ticket’]) &amp;amp;&amp;amp; $_GET[‘ticket’] != ‘’ &amp;amp;&amp;amp; !&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;isset($_SESSION[‘phpCAS’])){
  include_once(‘modules/Users/Authenticate.php’);
}
&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now we will be able to validate our ticket from CAS server and prepare sessions in order to authenticate in Vtiger.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Changes for Logout  from CAS from Vitger&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-weight: 800;&quot;&gt;Edit  :- Logout.php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Added Following Line of Code to enable logout from CAS session in vtiger&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;require_once(&#39;modules/CAS.php&#39;);
phpCAS::client(CAS_VERSION_2_0,&#39;CAS Server&#39;,8443,&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 100%;&quot;&gt;&#39;cas-web&#39;,FALSE);
phpCAS::logoutWithRedirectService(&#39;Your Site Name&#39;);
&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I hope these steps will help you in your Projects&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If still have any doubts , feel free to put your doubts here&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1404487563332298735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1404487563332298735'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2012/04/integrate-vtiger-with-cas.html' title='Integrate Vtiger with CAS'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-1292254538718471993</id><published>2011-11-06T23:33:00.000+05:30</published><updated>2011-11-06T23:36:42.517+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache installation"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>How to install apache and php on Linux Red Hat 64 bit</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;In order to enable server listen web requests, we need to install apache on server&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;Following steps have been performed on linux red hat 64 bit operating system &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;1:- First login as root on server through Putty&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;2:- Perform yum installation of apache (&lt;/span&gt;Yum is an automatic updater and  package installer/remover for rpm systems) &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;   Type following commands&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;# yum install httpd httpd-devel &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN&quot;&gt;After installation test your installation by executing following command&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# service httpd start&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;With this, your apache has been successfully started.&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3:- Configure APACHE&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;For this, we have to edit httpd.conf file located at /etc/httpd/conf/http.conf&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Type following command&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;# sudo nano httpd.conf&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Now edit following entry&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Servername IP ADDRESS:80&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Now restart your server, type following command&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;# service httpd restart&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;Your apache installation is complete now&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2:- Install PHP&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1:- Type following command&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# yum install php&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;With this your PHP have been installed on server&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2:- Create a file named index.php where by default apache will point to&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Type following commands&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# cd /var/www/html&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# sudo nano index.php&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Now type following code inside it&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;?php phpinfo(); ?&amp;gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;and Save it &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3:- Restart apache&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# service httpd restart&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Final Step is to test installation of php and apache on server&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Open web browser and type &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://184.72.96.245/&quot;&gt;https://your ip address&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;It should open all the information about php extensions etc&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Note:- &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;If after successful installation of apache,it does not listen to web request simply type following commands&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;# iptables -I INPUT -p tcp --dport 80 -j ACCEPT&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# /etc/init.d/iptables save &lt;/span&gt;&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1292254538718471993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/1292254538718471993'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/11/how-to-install-apache-and-php-on-linux.html' title='How to install apache and php on Linux Red Hat 64 bit'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-8500870780438733505</id><published>2011-11-06T13:51:00.000+05:30</published><updated>2011-11-06T13:51:45.089+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="create instance"/><title type='text'>How to create and Instance on Amazon?</title><content type='html'>Login to amazon web services, Go to http://aws.amazon.com/&lt;br /&gt;
Now Go to Amazon EC2 and Launch Instance &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1puvPYDSp_iBfG7mg1g53e0fUmTgNF4NVwcV15V3cSs5WzAKlfrSd8dBpvsRD5w5J5HzD2u7uXOPofja89uUVYothfi0klbXkdcdAv1NGrv5zUdloK36lyKsX6Zli5SADDRItTAtBhifO/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1puvPYDSp_iBfG7mg1g53e0fUmTgNF4NVwcV15V3cSs5WzAKlfrSd8dBpvsRD5w5J5HzD2u7uXOPofja89uUVYothfi0klbXkdcdAv1NGrv5zUdloK36lyKsX6Zli5SADDRItTAtBhifO/s400/Untitled.png&quot; width=&quot;400&quot; /&gt; &lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Select Instance of your choice. &lt;br /&gt;
(In this case, we selected below mention machine).&lt;br /&gt;
Red Hat Enterprise Linux 6.1 64-bit&amp;nbsp;(AMI Id: ami-31d41658)&lt;br /&gt;
Red Hat Enterprise Linux 6.1, EBS-boot, 64-bit architecture.&lt;br /&gt;
Root Device Size:&amp;nbsp;6 GB&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Select Instance Type &lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh67DdIVHIhFQAEPg53e-R24QjpP3k21hlXvoy4Iag4nuS56QGeeURfUTx9ntFiaWEuBxZ7EDp_ypjHGCCXEbpmje-pTnunegFmDM7_v7EEdO4V67lSMHx9xS4kHEl6t_mNbDwrxi6TGT_5/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh67DdIVHIhFQAEPg53e-R24QjpP3k21hlXvoy4Iag4nuS56QGeeURfUTx9ntFiaWEuBxZ7EDp_ypjHGCCXEbpmje-pTnunegFmDM7_v7EEdO4V67lSMHx9xS4kHEl6t_mNbDwrxi6TGT_5/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Default Options&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJl0Y4JzpuKdE097KKumxCrWpGOhqV8uwx5UuFApyfDv7hKbs78iqDaqVe6AbL54ZP_s6T0mgjND5NAZ6_fNJblZVRHbuTYBibjLVY0gcF_O1VtaneVv3YJQeoWf-iOlOR2OETnZbSvMs/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJl0Y4JzpuKdE097KKumxCrWpGOhqV8uwx5UuFApyfDv7hKbs78iqDaqVe6AbL54ZP_s6T0mgjND5NAZ6_fNJblZVRHbuTYBibjLVY0gcF_O1VtaneVv3YJQeoWf-iOlOR2OETnZbSvMs/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt; &lt;br /&gt;
Give name key (not necessary)&lt;br /&gt;
(This will be the name of your Amazon EC2 instance).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLMdSWgp-_ldGL2U-RF0HOMBrFVaZD451UWLVnkEyAVooyl_fp968yelY-7GNbQVq_UcnzmjP2qSu5pRQtr6tvwAOSvdT7jzKQC6jWwb_DE8wl1riyGqvFYTfWK3xEm4yk6wjET66SooJE/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLMdSWgp-_ldGL2U-RF0HOMBrFVaZD451UWLVnkEyAVooyl_fp968yelY-7GNbQVq_UcnzmjP2qSu5pRQtr6tvwAOSvdT7jzKQC6jWwb_DE8wl1riyGqvFYTfWK3xEm4yk6wjET66SooJE/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Create new key pair and download it to your local machine.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyXLV7cJK44GN00aCvsFCvV2VOhQJk_IklQ_BWdEoh8IZvydwksYRHOouQPJqCeoTa0ZtJQ4ioIS15XHia4a5XSImgYyfhi2WK8mCgkZW3sbdjWCi1duD4KvKJv63bTVJgrnD1JhIT8npP/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyXLV7cJK44GN00aCvsFCvV2VOhQJk_IklQ_BWdEoh8IZvydwksYRHOouQPJqCeoTa0ZtJQ4ioIS15XHia4a5XSImgYyfhi2WK8mCgkZW3sbdjWCi1duD4KvKJv63bTVJgrnD1JhIT8npP/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;A .pem file will be downloaded to your machine. Keep it at safe place. It is the key which allow you to enter into Linux box.&lt;br /&gt;
Should be kept very safe.&lt;br /&gt;
Now create a new security group and add a new rule for SSH (port 22) connection. Adding this rule will allow you to connect to Linux instance through PuTTY or WinSCP (or any client which can establish SSH connection) from your local machine, which will establish ssh connection.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGs6SO4RapT93biWXB_hNKZkoQXbts0xizbRScqmhqL1xeeZDjPrabBOPs764sf6NH680H-eCrmmmmjj14vUqXMnzOtMs1lkSiNR9QKkOjeKGROp1MdoI7Vjg3QjlTbZU1cu9Iuc7PGWY9/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGs6SO4RapT93biWXB_hNKZkoQXbts0xizbRScqmhqL1xeeZDjPrabBOPs764sf6NH680H-eCrmmmmjj14vUqXMnzOtMs1lkSiNR9QKkOjeKGROp1MdoI7Vjg3QjlTbZU1cu9Iuc7PGWY9/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;Review and Launch Instance&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzIOKrTjTwobuNZig4mPMRdO3hFm6F58JZ-GT3TqKJC14sP8s82HIgzsVf8iVQAJBFBej62p7GtBL1MT_6qVcNluX6S6nZuiP3190-WRyMiWL6kq7vipBgDi-YySJEwUdTee37stACoAAk/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzIOKrTjTwobuNZig4mPMRdO3hFm6F58JZ-GT3TqKJC14sP8s82HIgzsVf8iVQAJBFBej62p7GtBL1MT_6qVcNluX6S6nZuiP3190-WRyMiWL6kq7vipBgDi-YySJEwUdTee37stACoAAk/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Within a minute, you will be able to see that instance is running.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhbPGnjt34WryMlG9eCSZVAl_-jB6e7-9lyLTx_G81qmf_fUd_7JaJBYozJ3HiYFRUTNH7nXVyA6W7dN7ZiQ_k3KlPHISkU6WoPwQ9TQzRMJp7CGBXfaceqjER3EDAq_4kRz-7rDZWtXck/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhbPGnjt34WryMlG9eCSZVAl_-jB6e7-9lyLTx_G81qmf_fUd_7JaJBYozJ3HiYFRUTNH7nXVyA6W7dN7ZiQ_k3KlPHISkU6WoPwQ9TQzRMJp7CGBXfaceqjER3EDAq_4kRz-7rDZWtXck/s320/Untitled.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Important to note:-&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;If instance is not in use, stop the instance. You will not lose the data.&lt;/li&gt;
&lt;li&gt;To remove the EC2 instance permanently, terminate it from “Instance Actions” menu.&lt;/li&gt;
&lt;li&gt;Once you terminate the instance, it is gone forever.&lt;/li&gt;
&lt;li&gt;Stopping an instance detach Elastic IP&amp;nbsp; associated with it.&lt;/li&gt;
&lt;li&gt;Security key is your gate pass to enter into Linux box. Keep it very safe.&lt;/li&gt;
&lt;li&gt;To enhance security, always associate a keypassphrase with PuTTY key.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/8500870780438733505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/8500870780438733505'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/11/how-to-create-and-instance-on-amazon.html' title='How to create and Instance on Amazon?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1puvPYDSp_iBfG7mg1g53e0fUmTgNF4NVwcV15V3cSs5WzAKlfrSd8dBpvsRD5w5J5HzD2u7uXOPofja89uUVYothfi0klbXkdcdAv1NGrv5zUdloK36lyKsX6Zli5SADDRItTAtBhifO/s72-c/Untitled.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-7953317766817119023</id><published>2011-10-23T13:45:00.000+05:30</published><updated>2013-05-15T00:16:29.664+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="DKIM"/><title type='text'>How to fix dkim = fail issue?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Few days ago, I had to implement DKIM (&lt;b&gt;Domain Keys Identified Mail&lt;/b&gt;) on a web server for some project , where emails were sent using AWS EC2 ( For more info on AWS&amp;nbsp;&lt;a href=&quot;http://aws.amazon.com/ec2/&quot;&gt;Click Here&lt;/a&gt;&amp;nbsp;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For this first of all i had created a simple compose mail form in html, i had made all the modifications required to send mails and now i was able to send mails, but there was just one problem, i was not getting (dkim=pass) in my mail headers, I tried everything, searched a lot on&amp;nbsp;Google, but no use.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Then suddenly i got an idea, I checked my inbox, and there i checked headers of one mail that i had&amp;nbsp;received&amp;nbsp;few days ago, when i checked them everything was same, with just a single difference, and that was answer to my problem&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I had change settings of dkim-milter at &amp;nbsp;(/etc/sysconfig/dkim-milt) and changed CANON=simple to CANON=relaxed/relaxed&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For more information on dkim (&lt;a href=&quot;http://dkim.org/&quot;&gt;click here&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;If you have any questions on this , feel free to ask&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7953317766817119023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/7953317766817119023'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/10/how-to-fix-dkim-fail-issue.html' title='How to fix dkim = fail issue?'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-6757419138854735166</id><published>2011-10-02T21:00:00.001+05:30</published><updated>2011-10-02T21:01:18.253+05:30</updated><title type='text'>A simple trick to display Indian Rupee Symbol on a WebPage</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;If you want to display Indian Rupee Symbol on a Web Page , then follow these simple steps  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;First of all add following lines in your head tag of HTML page&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;script src=&quot;http://cdn.webrupee.com/js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://cdn.webrupee.com/font&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;Now just following line where ever you want to display it on your page in body tag&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;span class = “WebRupee”&amp;gt; &amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/6757419138854735166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/6757419138854735166'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/10/simple-trick-to-display-indian-rupee.html' title='A simple trick to display Indian Rupee Symbol on a WebPage'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-6880391563666363607</id><published>2011-09-04T15:29:00.000+05:30</published><updated>2011-09-04T15:31:20.354+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CALL_USER_FUNC"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>How to call a variable as a function in php</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Code Optimization had always been major concern for all the Software developers. Today through this post of mine, you can optimize your code to a great extent in a situation, where you want to call different functions according to certain conditions.  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Say, you want to call a certain function according to certain value of variable which in turns comes from database. Now if you will follow normal approach, your code will become too large to be managed, in addition of writing separate function, you will write numerous conditions, which will make your code quite typical.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In order to make it simple, we will just use an inbuilt function of PHP named “call_user_func” through which you can use that particular variable as a function.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;I will explain you its functionality using following code.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:&quot;Table Normal&quot;;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:&quot;&quot;;
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb; font-size: 10.0pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-language: EN-US;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt;/*&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt;Say I wrote a simple function to increment a value based on database value ie whether to decrement or increment a value&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;*/&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;increment&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$var&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;)&lt;/span&gt;&lt;/code&gt; &lt;code&gt;{&lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt; &lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$var&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;++;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;&lt;br /&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt;&lt;code&gt;&lt;/code&gt;$a = 0;&lt;br /&gt;
&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$database_value = $bla bla&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;call_user_func&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;(&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$database_value&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$a&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;// here second parameters indicates the parameter to be passed&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt; &lt;code&gt;echo&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;$a&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;.&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&quot;\n&quot;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #007700;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;Now the concept is you will just add a separate column in database which will store the name of function to be called, say increment or decrement. Now each time you want to increment or decrement, just fetch function name from database and call it using this call_user_func &lt;/span&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: justify;&quot;&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/6880391563666363607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/6880391563666363607'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/09/how-to-call-variable-as-function-in-php.html' title='How to call a variable as a function in php'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6972890547425817909.post-3375266501668691435</id><published>2011-07-24T16:45:00.000+05:30</published><updated>2011-07-24T16:48:08.064+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spyware"/><title type='text'>Spyware in brief</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.blogsdna.com/wp-content/uploads/2010/11/spywaredoctor2011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;319&quot; src=&quot;http://www.blogsdna.com/wp-content/uploads/2010/11/spywaredoctor2011.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Spyware is a type of malware that can be installed on computers, and which collects small pieces of information about users without their knowledge or In simple terms, it is a way for shareware authors to make money from a product, other than by selling it to the users.There are several large media companies that offer them to place banner ads in their products in exchange for a portion of the revenue from banner sales. This way, you don&#39;t have to pay for the software and the developers are still getting paid.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There are thousands of known spyware, But here are a few:&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Alexa&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt; Aureate/Radiate&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;BargainBuddy&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;ClickTillUWin&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now the Question comes how to remove Spyware?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Spybot-S&amp;amp;D &lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Detects and removes spyware of different kinds (dialers, loggers, trojans, user tracks) from your computer. Blocks ActiveX downloads, tracking cookies and other threats. &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Spy Sweeper&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Detects and removes spyware of different kinds (dialers, loggers, trojans, user tracks) from your computer.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;HijackThis&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;HijackThis is a tool, that lists all installed browser add-on, buttons, startup items and allows you to inspect them, and optionally remove selected items.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;With all the above mentioned tools , you can easily remove spyware from your computer, now since Precaution is better than cure ,To prevent &quot;spyware&quot; being install. you can use following software&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;SpywareBlaster&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;SpywareBlaster doesn`t scan and clean for so-called spyware, but prevents it from being installed in the first place. It achieves this by disabling the CLSIDs of popular spyware ActiveX controls, and also prevents the installation of any of them via a webpage.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;SpywareGuard&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;SpywareGuard provides a real-time protection solution against so-called spyware. It works similar to an anti-virus program, by scanning EXE and CAB files on access and alerting you if known spyware is detected.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;XP-AntiSpy&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;XP-AntiSpy is a small utility to quickly disable some built-in update and authentication features in WindowsXP that may rise security or privacy concerns in some people.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;So with this i will complete my post , i hope till now you have got some idea what is this spyware? how to remove and prevent them? If still have some query feel free to ask&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3375266501668691435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6972890547425817909/posts/default/3375266501668691435'/><link rel='alternate' type='text/html' href='http://goyal1989.blogspot.com/2011/07/spyware-in-brief.html' title='Spyware in brief'/><author><name>Manish K  Goyal</name><uri>http://www.blogger.com/profile/14329597771614836458</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>