<?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: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-8328462747836488182</id><updated>2011-07-08T05:49:24.205-07:00</updated><category term='drupal'/><category term='Pear'/><category term='PHP'/><category term='Magento'/><category term='jQuery'/><category term='MySQL'/><category term='javascript'/><category term='.module'/><category term='PHP OpenSource MySQL'/><category term='coloring syntax'/><category term='Eclipse'/><category term='vps'/><title type='text'>divyのsh karelia</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-7046657550149837090</id><published>2010-09-09T04:24:00.001-07:00</published><updated>2010-09-09T04:26:53.119-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>term of taxonomy used as menu item in drupal</title><content type='html'>sometime our requirement is different that Drupal behaviour.&lt;br /&gt;client wants to put some Taxonomy term as Primary menu. The taxonomy menu module adds links to the navigation menu for taxonomy terms.&lt;br /&gt;&lt;br /&gt;(1) Install taxonomy menu module&lt;br /&gt;(2) make some setting of taxonomy menu module&lt;br /&gt;&lt;br /&gt;now we want to change path of these term in menu. it provides some hook for ..&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/**&lt;br /&gt;* Implementation of hook_taxonomy_menu_path.&lt;br /&gt;*&lt;br /&gt;* @return array&lt;br /&gt;*  function name =&gt; Display Title&lt;br /&gt;*  a list of the path options.&lt;br /&gt;*/&lt;br /&gt;function ess_public_taxonomy_menu_path() {&lt;br /&gt;&lt;br /&gt;  $output = array('ess_public_menu_path_default' =&gt; t('Ess Category Search'));&lt;br /&gt;  &lt;br /&gt;  return $output;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Callback for hook_taxonomy_menu_path&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;function ess_public_menu_path_default($vid, $tid) {&lt;br /&gt;  //if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....&lt;br /&gt; &lt;br /&gt;if ($tid == 0) {&lt;br /&gt;    //get all of the terms for the vocab&lt;br /&gt;    $path = "ess_public/search_result/category/";&lt;br /&gt;  }&lt;br /&gt;  else {&lt;br /&gt;    $path = taxonomy_term_path(taxonomy_get_term($tid));&lt;br /&gt;&lt;br /&gt;    if (variable_get('taxonomy_menu_display_descendants_'. $vid, FALSE)) {&lt;br /&gt;      //Use 'all' at the end of the path&lt;br /&gt;      $term = taxonomy_get_term($tid);      &lt;br /&gt;      $path = "ess_public/search_result/category/".$term-&gt;name;&lt;br /&gt;      &lt;br /&gt;      if (variable_get('taxonomy_menu_end_all_'. $vid, FALSE)) {&lt;br /&gt;       // $path .= '/all';&lt;br /&gt;       $term = taxonomy_get_term($tid);      &lt;br /&gt;      $path = "ess_public/search_result/category/".$term-&gt;name;&lt;br /&gt;      }&lt;br /&gt;      else {&lt;br /&gt;        //we wait to run this instead of durning the if above&lt;br /&gt;        //because we only wan to run it once.&lt;br /&gt;        $terms = taxonomy_get_tree($vid, $tid);&lt;br /&gt;        foreach ($terms as $term) {&lt;br /&gt;          $tids[] = $term-&gt;tid;&lt;br /&gt;        }&lt;br /&gt;        if ($tids) {&lt;br /&gt;          $end = implode(' ', $tids);&lt;br /&gt;          $path .= $end;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;     $term = taxonomy_get_term($tid);      &lt;br /&gt;       $path = "ess_public/search_result/category/".$term-&gt;name;    &lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  return $path;&lt;br /&gt;}&lt;br /&gt; &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-7046657550149837090?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/7046657550149837090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=7046657550149837090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7046657550149837090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7046657550149837090'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/09/term-of-taxonomy-used-as-menu-item-in.html' title='term of taxonomy used as menu item in drupal'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-719400894927529746</id><published>2010-08-20T21:12:00.000-07:00</published><updated>2010-08-20T21:14:07.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySql sorting fields in which certain order.</title><content type='html'>MySql provides nice functionality to sort fields in certain order. This is very useful in scenarios where we have an enum Field represented as varchar and the values that it can hold are fairly static.&lt;br /&gt;&lt;br /&gt;CHANNELS&lt;br /&gt;——————————–&lt;br /&gt;| ID | NAME | TYPE |&lt;br /&gt;——————————–&lt;br /&gt;TYPE field is a varchar that can take only SD, HD and 3D. &lt;br /&gt;&lt;br /&gt;PROBLEM:&lt;br /&gt;&lt;br /&gt;To get a list of channels sorted by TYPE in an order of SD, HD and 3D. This can be done in couple of different ways:&lt;br /&gt;-- Using by FIELD&lt;br /&gt;SELECT * FROM CHANNELS ORDER BY FIELD(TYPE, 'SD', 'HD', '3D'); &lt;br /&gt;&lt;br /&gt;-- Using by FIND_IN_SET&lt;br /&gt;SELECT * FROM CHANNELS ORDER BY FIND_IN_SET(TYPE, 'SD,HD,3D');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-719400894927529746?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/719400894927529746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=719400894927529746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/719400894927529746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/719400894927529746'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/08/mysql-sorting-fields-in-which-certain.html' title='MySql sorting fields in which certain order.'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-2162455921070700978</id><published>2010-07-12T20:53:00.000-07:00</published><updated>2010-07-12T21:19:26.148-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>programmatically create or add new Taxonomy Terms in drupal</title><content type='html'>To create a new taxonomy term through PHP you can use taxonomy_save_term(&amp;$form_values) which is mainly intended for use as a helper function to by the real drupal taxonomy add term form. &lt;br /&gt;The relevant term details are passed as parameter and the Term Id of the newly created taxonomy term is placed back in this array and can be accessed by the calling code.&lt;br /&gt;&lt;br /&gt;here I explain small code to assign taxonomy term to node if taxonomy is new , first you save in taxonomy in db.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/**&lt;br /&gt; * Save Node &lt;br /&gt; */&lt;br /&gt;foreach($arrNodeIds as $intNodeId){&lt;br /&gt;      $objNodeInfo = node_load($intNodeId);&lt;br /&gt;      $arrTermsIds = getTermIds($_POST['txt_tag_val_'.$intNodeId]);&lt;br /&gt;      $objNodeInfo-&gt;taxonomy = $arrTermsIds;&lt;br /&gt;      node_save($objNodeInfo);&lt;br /&gt;} &lt;br /&gt;/**&lt;br /&gt; * See If the term exists in the chosen vocabulary and return the tid; otherwise, add a new record.&lt;br /&gt; * @param $strTerms&lt;br /&gt; *   - Terms Name&lt;br /&gt; * @return&lt;br /&gt; *   - Terms Ids&lt;br /&gt; */&lt;br /&gt;function getTermIds($strTerms){&lt;br /&gt;    $arrTerms = explode(",",$strTerms);&lt;br /&gt;    if(!is_array($arrTerms)){&lt;br /&gt;     $arrTerms[0] = $strTerms;&lt;br /&gt;    }&lt;br /&gt;    foreach ($arrTerms as $strTerm){&lt;br /&gt; if(strlen($strTerm) &gt; 0){&lt;br /&gt;     $possibilities = taxonomy_get_term_by_name(trim($strTerm));&lt;br /&gt;     $intTermTid = NULL; &lt;br /&gt;     foreach ($possibilities as $possibility){&lt;br /&gt;      $intTermTid = $possibility-&gt;tid;&lt;br /&gt;     }&lt;br /&gt;          // Check new term , If yes then insert this new term in db &lt;br /&gt;   if (!$intTermTid){&lt;br /&gt;  $arrParam = array('vid' =&gt; 2, 'name' =&gt; $strTerm); &lt;br /&gt;  $status = taxonomy_save_term($arrParam);&lt;br /&gt;  $intTermTid = $arrParam['tid'];          &lt;br /&gt;   }&lt;br /&gt;   $arrTermIds[] = $intTermTid;&lt;br /&gt; }&lt;br /&gt;   }&lt;br /&gt;   return $arrTermIds;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * add a new record as Term of Texonomy.&lt;br /&gt; * @param $arrParam&lt;br /&gt; *   - param (vid , name) &lt;br /&gt; * @return&lt;br /&gt; *   - status &lt;br /&gt; */&lt;br /&gt;function addTaxonomyTerm($arrParam){&lt;br /&gt;    $vid = $arrParam['vid'];&lt;br /&gt;    $name = trim($arrParam['name']);&lt;br /&gt;    return taxonomy_save_term($form_values);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-2162455921070700978?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/2162455921070700978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=2162455921070700978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2162455921070700978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2162455921070700978'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/programmatically-create-or-add-new.html' title='programmatically create or add new Taxonomy Terms in drupal'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-1614532361247000587</id><published>2010-07-08T22:46:00.000-07:00</published><updated>2010-07-08T22:50:24.454-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>Create block by drupal code</title><content type='html'>If you most likely want to generate a block using code / programming , it is simple develope following code for that as I explain here.&lt;br /&gt;&lt;br /&gt;Once you know the module and the delta, It is simple for creating the block.&lt;br /&gt;The trick is you need to send an object with the right parameters. The code below should get you started. Remember this code may be different in Drupal7&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Load drupal Block By Delta &amp; Module&lt;br /&gt; *&lt;br /&gt; * @param $strModule&lt;br /&gt; *   - Module Name&lt;br /&gt; *&lt;br /&gt; * @param $intDelta&lt;br /&gt; *   - Module Name&lt;br /&gt; *&lt;br /&gt; * @return&lt;br /&gt; *   - Themed Block HTML&lt;br /&gt; */&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function loadDrupalBlock($strModule, $intDelta) { &lt;br /&gt;  $block = new stdclass(); // empty object&lt;br /&gt;  $module = $strModule;&lt;br /&gt;  $delta = $intDelta; // could also be a string&lt;br /&gt;  &lt;br /&gt;  $array = module_invoke($module, 'block', 'view', $delta);&lt;br /&gt;  if (isset($array) &amp;&amp; is_array($array)) {&lt;br /&gt;    foreach ($array as $k =&gt; $v) {&lt;br /&gt;      $block-&gt;$k = $v;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  $block-&gt;module = $module;&lt;br /&gt;  $block-&gt;delta = $delta;&lt;br /&gt;  return theme('block', $block);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is calling by this way&lt;br /&gt;$staticBlockHtml = loadDrupalBlock('block', 7);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-1614532361247000587?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/1614532361247000587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=1614532361247000587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1614532361247000587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1614532361247000587'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/create-block-by-drupal-code.html' title='Create block by drupal code'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-8090395239658812202</id><published>2010-07-07T04:28:00.000-07:00</published><updated>2010-07-07T04:35:02.690-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>Delete many thousands of nodes</title><content type='html'>We recently had reason to delete over a thousand Drupal 6 nodes of the same type,&lt;br /&gt;but we wanted to leave all other content on the site intact.&lt;br /&gt;&lt;br /&gt;What do you do when you want to delete multiple nodes from a drupal site?&lt;br /&gt;You go to admin » content and then delete nodes one by one or delete up to 50 nodes at one time?&lt;br /&gt;&lt;br /&gt;In this example we will delete all nodes of a particular type (page), It is quick way to delete&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$node_type = 'image_album';     //fetch the nodes we want to delete  &lt;br /&gt;$result = db_query("SELECT nid FROM {node} WHERE type='%s'",$node_type);&lt;br /&gt;while ($row = db_fetch_object($result)){  &lt;br /&gt;  node_delete($row-?&gt;nid);&lt;br /&gt;  $deleted_count+=1;&lt;br /&gt;}&lt;br /&gt;//simple debug message so we can see what had been deleted.&lt;br /&gt;drupal_set_message("$deleted_count nodes have been deleted");&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-8090395239658812202?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/8090395239658812202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=8090395239658812202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8090395239658812202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8090395239658812202'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/delete-many-thousands-of-nodes.html' title='Delete many thousands of nodes'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-6579761255569823442</id><published>2010-07-05T21:09:00.000-07:00</published><updated>2010-07-06T00:32:22.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>conformation alert using javascript</title><content type='html'>Sometimes it is useful to display a confirmation message before processing any action. Some application often asks for confirmation before doing something irreversible, like deleting content. &lt;br /&gt;the user to conform once again the deleting process. Here the user can change his mind and can cancel the operation or conform his action by clicking the submit button.&lt;br /&gt;&lt;p&gt;function confirmDelete(item){&lt;br /&gt; var strMsg = "Are you sure you want to delete this "+item+" ? ";&lt;br /&gt; var intAgree = confirm(strMsg);&lt;br /&gt; if (intAgree)&lt;br /&gt;  return true ;&lt;br /&gt; else&lt;br /&gt;  return false ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-6579761255569823442?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/6579761255569823442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=6579761255569823442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6579761255569823442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6579761255569823442'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/conformation-alert-using-javascript.html' title='conformation alert using javascript'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-7005364479200661123</id><published>2010-07-02T22:41:00.000-07:00</published><updated>2010-07-06T23:43:51.370-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Pass an array from an HTML form using Hidden field</title><content type='html'>&lt;p&gt;It is simple way to pass your array using hidden field of form and get to another side  where you want to use this array's value&lt;/p&gt;&lt;br /&gt;Snippet&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Create Array&lt;/u&gt;&lt;pre&gt;&lt;br /&gt;$arrNodeIds = array();&lt;br /&gt;foreach ($data as $k =&gt; $objNode) {&lt;br /&gt;  $arrNodeIds[] = $objNode-&gt;nid;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;Assign array to hideen field of form&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;form method=&amp;quot;post&amp;quot; action=&amp;quot;/ess_upload/save_images&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;hdnArrNodeIds&amp;quot; value=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;Get value from other side&lt;/u&gt;&lt;pre&gt;&lt;br /&gt;$arrNodeIds = unserialize(urldecode($_POST["hdnArrNodeIds"]));&lt;br /&gt;foreach($arrNodeIds as $intNodeId){&lt;br /&gt;    echo $intNodeId;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-7005364479200661123?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/7005364479200661123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=7005364479200661123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7005364479200661123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7005364479200661123'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/pass-array-from-html-form-using-hidden.html' title='Pass an array from an HTML form using Hidden field'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-4578417344487028111</id><published>2010-07-01T05:46:00.000-07:00</published><updated>2010-07-01T05:53:57.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>Check Node is Exists In Drupal</title><content type='html'>&lt;p&gt;It is good way to check Node is exists or not bellow example code would be helpful &lt;/p&gt;&lt;p&gt;In this example , If node is exists in our database, then It will be deleted. otherwise give a error message and redirect to perticular page.&lt;/p&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;/span&gt; :&lt;br /&gt;  $bolIsNodeAvail = node_load(array('nid' =&gt; $intNodeId)); &lt;br /&gt;  if($bolIsNodeAvail != false)&lt;br /&gt;  {&lt;br /&gt;           node_delete($intNodeId);   &lt;br /&gt;  }else{&lt;br /&gt;           drupal_set_message(t("node id is not exists."), 'error');    &lt;br /&gt;  }&lt;br /&gt;  drupal_goto('ess_upload/album_images');&lt;br /&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-4578417344487028111?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/4578417344487028111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=4578417344487028111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4578417344487028111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4578417344487028111'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/check-node-is-exists-in-drupal.html' title='Check Node is Exists In Drupal'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-1717112762993934916</id><published>2010-07-01T02:13:00.000-07:00</published><updated>2010-07-01T05:15:23.798-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>Insert and Update Record using drupal_write_record()</title><content type='html'>&lt;p&gt;It saves a record to the database based upon the schema.&lt;/p&gt;&lt;p&gt;you can simply call the new drupal_write_record function telling it what database table to write to and the information to write and the function will do the rest. SO you'll find yourself writing less and less of those long db_query insert and update commands!&lt;/p&gt;&lt;strong&gt;Insert Record To Table&lt;/strong&gt;&lt;br /&gt;This would insert all the data in the $node object into the node database table.&lt;br /&gt;&lt;br /&gt;drupal_write_record('node', $node);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example :&lt;/span&gt;&lt;br /&gt;$objFile = new stdClass();&lt;br /&gt;$objFile-&gt;uid = $uId;&lt;br /&gt;$objFile-&gt;filemime = $arrFile['str_file_mime'];&lt;br /&gt;$objFile-&gt;filesize = $arrFile['int_file_size'];&lt;br /&gt;$objFile-&gt;status = FILE_STATUS_PERMANENT;  &lt;br /&gt;$objFile-&gt;timestamp = time();&lt;br /&gt;drupal_write_record('files', $objFile);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Update Record In Table&lt;/strong&gt;&lt;br /&gt;This would update the node in the node database table with the data in the $node object &lt;br /&gt;where nid is equal to the $node-&gt;nid&lt;br /&gt;&lt;br /&gt;&lt;p&gt;drupal_write_record('node', $node, 'nid')&lt;/p&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Example :&lt;/span&gt;&lt;br /&gt;$strFileExtension = getFileExtension($arrFile['str_orgin_file_name']);  &lt;br /&gt;$strFileNewName = $objFile-&gt;fid.".".$strFileExtension;  &lt;br /&gt;$objFile-&gt;filename = $strFileNewName;  &lt;br /&gt;$objFile-&gt;filepath = $arrFile['str_rel_file_path'].$uId.DIRECTORY_SEPARATOR.$strFileNewName;&lt;br /&gt;drupal_write_record('files', $objFile,'fid');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-1717112762993934916?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/1717112762993934916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=1717112762993934916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1717112762993934916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1717112762993934916'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/07/insert-and-update-record-using.html' title='Insert and Update Record using drupal_write_record()'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-5937431212301019406</id><published>2010-06-30T21:15:00.000-07:00</published><updated>2010-06-30T21:24:09.372-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>How to do saved Node and get that node Id</title><content type='html'>&lt;p&gt;I was trying to create a new node programatically by inserting information in node, I used below snippet.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;  Saved Node&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;  $objNode = new StdClass();&lt;br /&gt;  $objNode-&gt;title = utf8_encode($strTitle);&lt;br /&gt;  $objNode-&gt;type = 'album_image';&lt;br /&gt;  $objNode-&gt;status = 1;&lt;br /&gt;  $objNode-&gt;moderate = 0;&lt;br /&gt;  $objNode-&gt;promote = 0;&lt;br /&gt;  $objNode-&gt;sticky = 0;&lt;br /&gt;  $objNode-&gt;revision = 0;&lt;br /&gt;  $objNode-&gt;comment = 0;&lt;br /&gt;  $objNode = node_submit($objNode);&lt;br /&gt;&lt;br /&gt;  $intTimestamp = time();&lt;br /&gt;  $objNode-&gt;uid = $uId;&lt;br /&gt;  $objNode-&gt;created = $intTimestamp;&lt;br /&gt;  $objNode-&gt;changed = $intTimestamp;&lt;br /&gt;  node_save($objNode);&lt;br /&gt; &lt;/p&gt;&lt;p&gt;  &lt;strong&gt;How to get the nid after node_save() in drupal 6&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;  Previously node_save() returned the $nid but not anymore... so what do we do? &lt;/p&gt;&lt;p&gt;  It's simple. You have just saved a variable as your node. in our case we use $objNode &lt;/p&gt;&lt;p&gt;  intInsertedNodeID = $objNode-&gt;nid;&lt;/p&gt;&lt;p&gt;  It is easy to use &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-5937431212301019406?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/5937431212301019406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=5937431212301019406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5937431212301019406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5937431212301019406'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/06/how-to-do-saved-node-and-get-that-node.html' title='How to do saved Node and get that node Id'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-3632402153870544644</id><published>2010-06-23T02:27:00.000-07:00</published><updated>2010-06-23T02:31:41.824-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Pass Finnish character to ajax request and get junk character (skandinavian charachters)</title><content type='html'>I have found some of character passes ajax through php file and get stange output (skandinavian charachters)&lt;br /&gt;&lt;br /&gt;I pass data with escape() function [escape(output)]. see in bellow snippet&lt;br /&gt;&lt;br /&gt;Passed such string to ajax call: &lt;div style="text-align: left;"&gt;Klikkaa lisätäksesi&lt;br /&gt;tekstiä&lt;/div&gt;&lt;br /&gt;and get result of such string  &lt;div style="text-align: left;"&gt;Klikkaa lis�t�ksesi&lt;br /&gt;teksti�&lt;/div&gt;&lt;br /&gt;what's problem occure in this script&lt;br /&gt;&lt;br /&gt;    var callBackActUrl = "dvk.eirikvae.aum"&lt;br /&gt;    var textdata = "text="+escape(output);&lt;br /&gt;    jQuery.ajax({&lt;br /&gt;     type: "POST",&lt;br /&gt;     url: callBackActUrl,&lt;br /&gt;     data: textdata,&lt;br /&gt;     cache: false,&lt;br /&gt;     success:function(responseText){&lt;br /&gt;       alert(responseText);&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt; });&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt; I had read lot of artical on google and find solution for. I passed data in ajax using escape function, we replaced escape() function with&lt;br /&gt;encodeURIComponent() and it is working proper.&lt;br /&gt;&lt;br /&gt;var textdata = "text="+encodeURIComponent(output);&lt;br /&gt;&lt;br /&gt;This method will encode certain chars that would normally be recognized as special chars for URIs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-3632402153870544644?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/3632402153870544644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=3632402153870544644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3632402153870544644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3632402153870544644'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/06/pass-finnish-character-to-ajax-request.html' title='Pass Finnish character to ajax request and get junk character (skandinavian charachters)'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-7222809106107720569</id><published>2010-06-16T22:16:00.000-07:00</published><updated>2010-06-16T22:35:54.991-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>How to disable resizable textarea in drupal</title><content type='html'>&lt;p&gt;I am using the profile module but I remove the resizable textarea on the frontend of website.&lt;/p&gt; There doesn't seem to be an option to enable/disable in drupal  or even profile  module so I tried implementing this:&lt;br /&gt;&lt;br /&gt;Snippet :&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mymodule_form_alter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$form&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;,$form_state, $form_id&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;){&lt;br /&gt;&lt;/span&gt;        &lt;span style="color: rgb(0, 119, 0);"&gt;    if (&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$form&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;_id&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt; == 'user_register'){&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;                   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$form&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;['account_information']['profile_address'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'#resizable'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;false&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;It should only point to the profile module. I Couldn't find any other the right code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-7222809106107720569?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/7222809106107720569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=7222809106107720569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7222809106107720569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7222809106107720569'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/06/how-to-disable-resizable-textarea-in.html' title='How to disable resizable textarea in drupal'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-63504862841694489</id><published>2010-03-04T02:56:00.000-08:00</published><updated>2010-03-04T03:28:18.230-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Magento'/><title type='text'>Magento - Add External Javascript in CMS Static block</title><content type='html'>Template tags can be used on CMS pages in static blocks and in email templates also&lt;br /&gt;&lt;br /&gt;Template tag is special tag, it has text surrounded by double curly braces which has a special meaning to Magento,&lt;br /&gt;for example  {{store url=""}}.&lt;br /&gt;&lt;br /&gt;Problem :&lt;br /&gt;I have one javascript , "slide_home.js" and want to include in one cms Static Blocks&lt;br /&gt;This javascript file is in root-directory/js/commmon/slide_home.js&lt;br /&gt;&lt;br /&gt;Solution : (you can write this line at top of static blocks [tine mce editor] )&lt;br /&gt;/*&lt;br /&gt;     &lt;script src="%7B%7Bstore%20direct_url%20=%27js/common/slide_home.js%27%7D%7D"&gt;&lt;/script&gt;&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;learn more from here&lt;br /&gt;http://inchoo.net/ecommerce/magento/magento-cms-syntax-part1/&lt;br /&gt;&lt;script src="%7B%7Bstore%20direct_url%20=%27js/common/slide_home.js%27%7D%7D"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-63504862841694489?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/63504862841694489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=63504862841694489' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/63504862841694489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/63504862841694489'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/03/magento-add-external-javascript-in-cms.html' title='Magento - Add External Javascript in CMS Static block'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-8402138946585266607</id><published>2010-02-22T19:55:00.000-08:00</published><updated>2010-02-22T20:09:30.948-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Magento'/><title type='text'>Magento – Write Sql query</title><content type='html'>Simple step to execute MySQL query in Magento.&lt;br /&gt;&lt;pre&gt;(1) Select SQL :&lt;br /&gt;&lt;br /&gt;$objCon = Mage::getSingleton('core/resource')-&gt;getConnection('core_write');&lt;br /&gt;$result = $objCon-&gt;query('SELECT 'entity_id' FROM 'catalog_product_entity');&lt;br /&gt;&lt;br /&gt;if(!$result) {&lt;br /&gt; $rows = $result-&gt;fetch(PDO::FETCH_ASSOC);&lt;br /&gt; if(!$rows) {&lt;br /&gt;    print_r($rows);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(2) Insert SQL :&lt;br /&gt;&lt;br /&gt;$objCon = Mage::getSingleton('core/resource')-&gt;getConnection('core_write');&lt;br /&gt;$objCon-&gt;query("insert into table name (fields) values (values) ");&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-8402138946585266607?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/8402138946585266607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=8402138946585266607' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8402138946585266607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8402138946585266607'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/02/write-sql-query-in-magento.html' title='Magento – Write Sql query'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-186289899213404009</id><published>2010-02-01T22:07:00.003-08:00</published><updated>2010-02-01T22:33:07.796-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Magento'/><title type='text'>Mage_Cms_Block_Widget_Interface not found</title><content type='html'>when I was developing Widget of magento in Magento EE version 1.6 . I have spent lot of time behind to fin it out  that Mage_Cms_Block_Widget_Interface is not working with Magento EE 1.6 version  and got like this "PHP Fatal error:  Interface 'Mage_Cms_Block_Widget_Interface' not found."&lt;br /&gt;&lt;br /&gt;After I got information about this interface that  It moved Mage_Cms_Block_Widget_Interface to &lt;span style="color: rgb(204, 102, 0); font-weight: bold;"&gt;Mage_Widget_Block_Interface&lt;/span&gt; in Magento EE version 1.6&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-186289899213404009?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/186289899213404009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=186289899213404009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/186289899213404009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/186289899213404009'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/02/magecmsblockwidgetinterface-not-found.html' title='Mage_Cms_Block_Widget_Interface not found'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-906478527370672853</id><published>2010-01-26T04:54:00.000-08:00</published><updated>2010-01-26T09:47:15.755-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Magento'/><title type='text'>Magento Admin login problem</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_BiThJX7sxNw/S18qlB5-fdI/AAAAAAAAAIk/TCemVxmEolM/s1600-h/magento-login1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 135px;" src="http://4.bp.blogspot.com/_BiThJX7sxNw/S18qlB5-fdI/AAAAAAAAAIk/TCemVxmEolM/s320/magento-login1.png" alt="" id="BLOGGER_PHOTO_ID_5431106491287240146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong style="color: rgb(255, 153, 0); font-weight: bold;"&gt;Problem:&lt;/strong&gt; &lt;p&gt;I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page. I could not enter the dashboard page. Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.&lt;/p&gt;&lt;p style="color: rgb(255, 153, 0);"&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;span id="more-135"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;I googled and found these solutions:-&lt;/p&gt; &lt;p&gt;1) Use 127.0.0.1 instead of localhost in your url, i.e. using http://127.0.0.1/magento/index.php/admin instead of&lt;br /&gt;http://localhost/magento/index.php/admin . But this didn’t solve my problem.&lt;/p&gt; &lt;p&gt;2) Since I am using Windows XP, I was suggested to open “host” file from&lt;br /&gt;C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.&lt;/p&gt; &lt;p&gt;3) This solution finally helped me out of this problem. The solution was to modify the core Magento code. Open &lt;strong&gt;app/code/core/Mage/Core/Model/Session/Abstract/Varien.php&lt;/strong&gt;. Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line: $this-&gt;getCookie()-&gt;getPath()//,&lt;/p&gt; &lt;p&gt;&lt;code&gt;// set session cookie params&lt;br /&gt;session_set_cookie_params(&lt;br /&gt;$this-&gt;getCookie()-&gt;getLifetime(),&lt;br /&gt;$this-&gt;getCookie()-&gt;getPath()&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;//,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt; //$this-&gt;getCookie()-&gt;getDomain(),&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt; //$this-&gt;getCookie()-&gt;isSecure(),&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt; //$this-&gt;getCookie()-&gt;getHttponly()&lt;/span&gt;&lt;br /&gt;);&lt;/code&gt;&lt;/p&gt; &lt;p&gt;Well, I am out of this problem. Hope, this solution you also help you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-906478527370672853?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/906478527370672853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=906478527370672853' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/906478527370672853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/906478527370672853'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/01/magento-admin-login-problem.html' title='Magento Admin login problem'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_BiThJX7sxNw/S18qlB5-fdI/AAAAAAAAAIk/TCemVxmEolM/s72-c/magento-login1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-13056220949150536</id><published>2010-01-18T23:36:00.000-08:00</published><updated>2010-01-19T00:57:05.930-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pear'/><title type='text'>Barcodes On your Web apps</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_BiThJX7sxNw/S1VzzdwKn2I/AAAAAAAAAII/eMvvrbKZjt4/s1600-h/barcode_img.php.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 143px; height: 80px;" src="http://3.bp.blogspot.com/_BiThJX7sxNw/S1VzzdwKn2I/AAAAAAAAAII/eMvvrbKZjt4/s320/barcode_img.php.png" alt="" id="BLOGGER_PHOTO_ID_5428372253862174562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The bar code is method of automatic identification and data collection.&lt;br /&gt;Their use is widespread and the technology behind barcodes is constantly improving.  Almost every item purchased from a grocery store, department store, and mass merchandiser has a UPC barcode on it. Now rarely will one come across any product that doesn’t have a barcode.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 0); font-weight: bold;"&gt;Varieties of barcodes&lt;/span&gt;&lt;br /&gt;Barcodes bascially come in two main type: linear (1-dimensional) and Matrix (2-dimensional) with each offering a variety of formats, depending on your application purpose&lt;br /&gt;&lt;br /&gt;(1) linear (1-dimensional) : The barcodes we usually see on books and other standard products are of the linear type. These only encode data in one dimension, from left to right. The following shows a typical UPC barcode.&lt;br /&gt;(2) Matrix (2-dimensional) : They also come in patterns of squares, dots, hexagons and other geometric patterns within images termed 2D (2 dimensional) matrix codes or symbologies.&lt;br /&gt;&lt;br /&gt;It is to use the PEAR::Image_Barcode class in PHP to dynamically create barcodes for Web applications. The backbone to the PEAR::Image_Barcode's ability to produce barcode images is in the GD library,If you haven't already installed PEAR, you will need to do so in order to get this application to work.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 0); font-weight: bold;"&gt;Installation&lt;/span&gt;&lt;br /&gt;You can install Image_Barcode issuing the following command (as root):&lt;br /&gt;# pear install Image_Barcode&lt;br /&gt;&lt;br /&gt;You can get the latest code at the PEAR site:&lt;br /&gt;http://pear.php.net/package/Image_Barcode/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt; Using Image_Barcode&lt;/span&gt;&lt;br /&gt;Creating a barcode is as simple as calling the classes static draw() method.&lt;br /&gt;The method has four parameters:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Text&lt;/span&gt;       : string that shall be converted into barcode representation.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Type&lt;/span&gt;      : this parameter determines which driver/type should be used; it is one of: Code39, code128, ean13, int25, postnet or upca.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Imgtype&lt;/span&gt; : determines the type of the image that is generated; one of jpg, png and gif.&lt;br /&gt;&lt;br /&gt;By default, the image generated by the barcode driver is directly output to the browser. If you do not want this, pass false as fourth parameter and draw() will return the GD image resource object; allowing you to do further things with it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt; Example code&lt;/span&gt;&lt;br /&gt;A sample code for generating a CODE128 barcode is shown below.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       /* Data that will be encoded in the bar code */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       $bar_code_data = "TRSD5656";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      /* The third parameter can accept any from the following,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       * jpg, png and gif.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      Image_Barcode::draw($bar_code_data, 'code128', 'png');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="font-family:courier new;"&gt; ?&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 0);"&gt;Supported Types&lt;/span&gt;&lt;br /&gt;The ‘Image_Barcode’ library supports the following barcode types:&lt;br /&gt;* Code 39&lt;br /&gt;* Code 128&lt;br /&gt;* EAN 13&lt;br /&gt;* INT 25&lt;br /&gt;* PostNet&lt;br /&gt;* UPCA&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-13056220949150536?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/13056220949150536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=13056220949150536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/13056220949150536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/13056220949150536'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2010/01/bar-code-is-method-of-automatic.html' title='Barcodes On your Web apps'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_BiThJX7sxNw/S1VzzdwKn2I/AAAAAAAAAII/eMvvrbKZjt4/s72-c/barcode_img.php.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-6692294997136257746</id><published>2009-12-25T07:14:00.000-08:00</published><updated>2009-12-25T07:15:06.081-08:00</updated><title type='text'>Changing Apache's www root directory</title><content type='html'>Sometimes it's necessary to change your current www root folder to something else. Maybe you have all your work files on a different partition than where you installed WAMP to or you have several websites you're working on and need to make one of them your primary site for a while (the one that shows up when entering localhost).&lt;br /&gt;&lt;br /&gt;Anything that has to do with Apache configuration can be done within a file called httpd.conf.&lt;br /&gt;&lt;br /&gt;  1. WAMP provides quick access to certain important files, one of them being httpd.conf.&lt;br /&gt;  2. Left-click WAMP icon and select Config files › httpd.conf.&lt;br /&gt;  3. The file will probably open up in Notepad.&lt;br /&gt;  4. Press Ctrl+F and enter documentroot.&lt;br /&gt;  5. Make sure case sensitive search is disabled and hit enter.&lt;br /&gt;  6. You should find a line that looks like DocumentRoot "C:/Program Files/wamp/www/".&lt;br /&gt;  7. Copy that line then put a # in front of it: #DocumentRoot "C:/Program Files/wamp/www/".&lt;br /&gt;  8. Paste the copied line just below and adjust it to where your custom root folder is located (e.g. DocumentRoot "C:/my_cool_site/").&lt;br /&gt;  9. Resume the search (usually by pressing F3) and you'll find a line like: &lt;directory program="" files="" wamp="" www=""&gt;.&lt;br /&gt; 10. Again copy the line, put a # in front, paste copied line below and adjust it (e.g. &lt;directory my_cool_site=""&gt;).&lt;br /&gt; 11. Save and close the file.&lt;br /&gt;&lt;br /&gt;Whenever you make a change to httpd.conf you have to restart Apache for it to take effect. The # we've added in front of the old lines turns them into a comment which Apache ignores. We just added them so that we can easily switch back to an old configuration by uncommenting the lines.&lt;br /&gt;&lt;br /&gt;  1. Left-click the WAMP icon and select Apache › Restart Service.&lt;br /&gt;  2. Wait for the icon status to change to white again.&lt;br /&gt;&lt;br /&gt;The root directory should now have changed to then one you've entered in httpd.conf. You can test this by entering localhost in your web browser. The index page in that folder (or the lack thereof) should show up now.&lt;/directory&gt;&lt;/directory&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-6692294997136257746?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/6692294997136257746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=6692294997136257746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6692294997136257746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6692294997136257746'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/12/changing-apaches-www-root-directory.html' title='Changing Apache&apos;s www root directory'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-1989168317160128784</id><published>2009-11-27T20:39:00.001-08:00</published><updated>2009-11-27T20:39:46.625-08:00</updated><title type='text'>How to get the Next Auto Increment ID in Mysql</title><content type='html'>Two way are there in mysql&lt;br /&gt;&lt;br /&gt;1st way :&lt;br /&gt;SELECT Auto_increment FROM information_schema.tables WHERE table_name='%s';"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2nd way using this sql :&lt;br /&gt;&lt;br /&gt;$rs = mysql_query("SHOW TABLE STATUS LIKE 'table_name' ");&lt;br /&gt;$row = mysql_fetch_array($rs);&lt;br /&gt;echo  $row['Auto_increment'];&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-1989168317160128784?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/1989168317160128784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=1989168317160128784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1989168317160128784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1989168317160128784'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/11/how-to-get-next-auto-increment-id-in.html' title='How to get the Next Auto Increment ID in Mysql'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-5421467203337965554</id><published>2009-09-07T02:15:00.000-07:00</published><updated>2009-09-07T02:16:19.881-07:00</updated><title type='text'>PHP Form Validation By Regular Expression ()</title><content type='html'>(1) PHP check valid url &lt;br /&gt;&lt;br /&gt;function valid_url($str)&lt;br /&gt;{&lt;br /&gt; return ( ! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $str)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(2) PHP numeric characters validator &lt;br /&gt;&lt;br /&gt;function numeric($str)&lt;br /&gt;{&lt;br /&gt; return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(3) PHP alpha-numeric characters validator &lt;br /&gt;&lt;br /&gt;function alpha_numeric($str)&lt;br /&gt;{&lt;br /&gt; return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(4)  PHP alpha characters validator&lt;br /&gt;&lt;br /&gt;function alpha($str)&lt;br /&gt;{&lt;br /&gt; return ( ! preg_match("/^([-a-z])+$/i", $str)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(5) PHP validate ip&lt;br /&gt;&lt;br /&gt;function valid_ip($ip)&lt;br /&gt;{&lt;br /&gt; return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(6) PHP validate email&lt;br /&gt;&lt;br /&gt;function valid_email($str)&lt;br /&gt;{&lt;br /&gt;  return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(7) PHP Windows Filename Validation&lt;br /&gt; function is_valid_filename($name) {&lt;br /&gt;    $parts=preg_split("/(\/|".preg_quote("\\").")/",$name);&lt;br /&gt;    if (preg_match("/[a-z]:/i",$parts[0])) {&lt;br /&gt;       unset($parts[0]);&lt;br /&gt;    }&lt;br /&gt;    foreach ($parts as $part) {&lt;br /&gt;       if (&lt;br /&gt;          preg_match("/[".preg_quote("^|?*&lt;\":&gt;","/")."\a\b\c\e\x\v\s]/",$part)||&lt;br /&gt;          preg_match("/^(PRN|CON|AUX|CLOCK$|NUL|COMd|LPTd)$/im",str_replace(".","\n",$part))&lt;br /&gt;       ) {&lt;br /&gt;          return false;&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;    return true;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference from : http://www.roscripts.com/snippets/show/61&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-5421467203337965554?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/5421467203337965554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=5421467203337965554' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5421467203337965554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5421467203337965554'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/09/php-form-validation-by-regular.html' title='PHP Form Validation By Regular Expression ()'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-516589571855089583</id><published>2009-09-06T23:19:00.000-07:00</published><updated>2009-09-07T02:14:03.508-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>important scrips for php (Part -1)</title><content type='html'>(1) Human readable Sizes &lt;br /&gt;&lt;br /&gt;function ByteSize ( $file_size )&lt;br /&gt;{&lt;br /&gt; $file_size = $file_size-1;&lt;br /&gt; if ($file_size &gt;= 1099511627776) $show_filesize = number_format(($file_size / 1099511627776),2) . " TB";&lt;br /&gt; elseif ($file_size &gt;= 1073741824) $show_filesize = number_format(($file_size / 1073741824),2) . " GB";&lt;br /&gt; elseif ($file_size &gt;= 1048576) $show_filesize = number_format(($file_size / 1048576),2) . " MB";&lt;br /&gt; elseif ($file_size &gt;= 1024)  $show_filesize = number_format(($file_size / 1024),2) . " KB";&lt;br /&gt; elseif ($file_size &gt; 0) $show_filesize = $file_size . " b";&lt;br /&gt; elseif ($file_size == 0 || $file_size == -1) $show_filesize = "0 b";&lt;br /&gt; return $show_filesize;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(2) Remove non alpha numeric characters &lt;br /&gt;&lt;br /&gt;function rem_non_alpha_numeric ( $string, $replace )&lt;br /&gt;{&lt;br /&gt; return preg_replace ( '/[^a-zA-Z0-9]/u', $replace, $string );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(3) PHP escape for SQL&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Correctly quotes a string so that all strings are escaped. We prefix and append&lt;br /&gt; * to the string single-quotes.&lt;br /&gt; * An example is  escape ( "Don't bother",magic_quotes_runtime () );&lt;br /&gt; *&lt;br /&gt; * @param str   the string to quote&lt;br /&gt; * @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc().&lt;br /&gt; *&lt;br /&gt; * @return  quoted string to be sent back to database&lt;br /&gt;*/&lt;br /&gt;function escape ( $str, $magic_quotes = false )&lt;br /&gt;{&lt;br /&gt;  switch ( gettype ( $str ) )&lt;br /&gt;  {&lt;br /&gt;   case 'string' :&lt;br /&gt;    $replaceQuote = "\\'";  /// string to use to replace quotes&lt;br /&gt;    if ( ! $magic_quotes ) {&lt;br /&gt;&lt;br /&gt;     if ( $replaceQuote [ 0 ] == '\\' ){&lt;br /&gt;      // only since php 4.0.5&lt;br /&gt;      $str = seo_str_replace ( array ( '\\', "\0" ), array ( '\\\\', "\\\0" ), $str );&lt;br /&gt;      //$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s));&lt;br /&gt;     }&lt;br /&gt;     return  "'" . str_replace ( "'", $replaceQuote, $str ) . "'";&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // undo magic quotes for "&lt;br /&gt;    $str = str_replace ( '\\"','"', $str );&lt;br /&gt;&lt;br /&gt;    if ( $replaceQuote == "\\'" ) {// ' already quoted, no need to change anything&lt;br /&gt;     return "'$str'";&lt;br /&gt;    }&lt;br /&gt;    else {// change \' to '' for sybase/mssql&lt;br /&gt;     $str = str_replace ( '\\\\','\\', $str );&lt;br /&gt;     return "'" . str_replace ( "\\'", $treplaceQuote, $str ) . "'";&lt;br /&gt;    }&lt;br /&gt;   break;&lt;br /&gt;   case 'boolean' : $str = ($str === FALSE) ? 0 : 1;&lt;br /&gt;      return $str;&lt;br /&gt;    break;&lt;br /&gt;   case 'integer' : $str = ($str === NULL) ? 'NULL' : $str;&lt;br /&gt;      return $str;&lt;br /&gt;    break;&lt;br /&gt;   default  : $str = ($str === NULL) ? 'NULL' : $str;&lt;br /&gt;      return $str;&lt;br /&gt;    break;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(4) PHP is keyword in string&lt;br /&gt;&lt;br /&gt;function is_keyword_in_string_bol ($keyword, $string)&lt;br /&gt;{&lt;br /&gt;  if ( strpos ( $string, $keyword ) === false )&lt;br /&gt;  {&lt;br /&gt;   return FALSE;&lt;br /&gt;  }&lt;br /&gt;  else {&lt;br /&gt;   return TRUE;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(5) PHP check url if valid&lt;br /&gt;&lt;br /&gt;function is_valid_url ( $url )&lt;br /&gt;{&lt;br /&gt;  $url = @parse_url($url);&lt;br /&gt;&lt;br /&gt;  if ( ! $url) {&lt;br /&gt;   return false;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $url = array_map('trim', $url);&lt;br /&gt;  $url['port'] = (!isset($url['port'])) ? 80 : (int)$url['port'];&lt;br /&gt;  $path = (isset($url['path'])) ? $url['path'] : '';&lt;br /&gt;&lt;br /&gt;  if ($path == '')&lt;br /&gt;  {&lt;br /&gt;   $path = '/';&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $path .= ( isset ( $url['query'] ) ) ? "?$url[query]" : '';&lt;br /&gt;&lt;br /&gt;  if ( isset ( $url['host'] ) AND $url['host'] != gethostbyname ( $url['host'] ) )&lt;br /&gt;  {&lt;br /&gt;   if ( PHP_VERSION &gt;= 5 )&lt;br /&gt;   {&lt;br /&gt;    $headers = get_headers("$url[scheme]://$url[host]:$url[port]$path");&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;    $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30);&lt;br /&gt;&lt;br /&gt;    if ( ! $fp )&lt;br /&gt;    {&lt;br /&gt;     return false;&lt;br /&gt;    }&lt;br /&gt;    fputs($fp, "HEAD $path HTTP/1.1\r\nHost: $url[host]\r\n\r\n");&lt;br /&gt;    $headers = fread ( $fp, 128 );&lt;br /&gt;    fclose ( $fp );&lt;br /&gt;   }&lt;br /&gt;   $headers = ( is_array ( $headers ) ) ? implode ( "\n", $headers ) : $headers;&lt;br /&gt;   return ( bool ) preg_match ( '#^HTTP/.*\s+[(200|301|302)]+\s#i', $headers );&lt;br /&gt;  }&lt;br /&gt;  return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(6) How to extract google search results using PHP&lt;br /&gt;&lt;br /&gt;&lt;?php &lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;       &lt;br /&gt;   if(!isset($_POST['q'])) &lt;br /&gt;   { &lt;br /&gt;       echo ' &lt;br /&gt;       &lt;!--form action="'.$_SERVER['PHP_SELF'].'" method="post"&gt; &lt;br /&gt;           &lt;input type="text" name="q"&gt; &lt;br /&gt;           &lt;input type="submit" value="search"&gt; &lt;br /&gt;       &lt;/form--&gt; &lt;br /&gt;   '; &lt;br /&gt;   }&lt;br /&gt;  else&lt;br /&gt;  { &lt;br /&gt;       // this would be the URL if you want the results on page 2, 3 ... where $_POST['p'] is multiple of 10 &lt;br /&gt;       // $off_site = 'http://www.google.com/search?q='.urlencode($_POST['q']).'&amp;start='.$_POST['p']; &lt;br /&gt;      $off_site = 'http://www.google.com/search?q='.urlencode($_POST['q']).'&amp;ie=UTF-8&amp;oe=UTF-8'; &lt;br /&gt;      $fp = fopen ($off_site, 'r') or die('Unable to open file '.$off_site.' for reading'); &lt;br /&gt;      while (!feof ($fp)) &lt;br /&gt;      { &lt;br /&gt;          $buf = trim(fgets($fp, 4096)); &lt;br /&gt;          $pos = strpos($buf,'&lt;p class=g&gt;'); &lt;br /&gt;          if($pos !== false) &lt;br /&gt;          { &lt;br /&gt;             $parts = explode('&lt;p class=g&gt;',$buf); &lt;br /&gt;             $parts2 = explode('http://',$parts[1]); &lt;br /&gt;             $parts3 = explode('&gt;',$parts2[1]); &lt;br /&gt;             echo '&lt;a href="http://'.$parts3[0].'" target="_blank"&gt;'.$parts3[0].'&lt;/a&gt;&lt;br&gt;'; &lt;br /&gt;           } &lt;br /&gt;       } &lt;br /&gt;   } &lt;br /&gt; &lt;br /&gt;       &lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;(7) PHP word wrap&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;/** * Example usage: *  &lt;br /&gt;* // Your text * $text = "This is a sentence which contains some words."; &lt;br /&gt;*  * // Or from a database result * $text = $row['text'];&lt;br /&gt;*  * // Then put it into the function * $text = word_wrap($text);&lt;br /&gt;*  * // Output the result * echo $text; */    function word_wrap($text)&lt;br /&gt;{        // Define the characters to display per row&lt;br /&gt;$chars = "10";        $text = wordwrap($text, $chars, "&lt;br /&gt;", 1);&lt;br /&gt;return $text;    &lt;br /&gt;}?&gt;&lt;br /&gt;&lt;br /&gt;8) Page load time calculator&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;// Insert this block of code at the very top of your page:&lt;br /&gt;$time = microtime();$time = explode(" ", $time);&lt;br /&gt;$time = $time[1] + $time[0];$start = $time;&lt;br /&gt;// Place this part at the very end of your page$time = microtime();&lt;br /&gt;$time = explode(" ", $time);$time = $time[1] + $time[0];&lt;br /&gt;$finish = $time;$totaltime = ($finish - $start);&lt;br /&gt;printf ("This page took %f seconds to load.", $totaltime);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(9) PHP limit words&lt;br /&gt;&lt;br /&gt;function word_limiter($str, $n = 100, $end_char = '&amp;#8230;')&lt;br /&gt;{&lt;br /&gt; if (strlen($str) &lt; $n)&lt;br /&gt; {&lt;br /&gt;  return $str;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; $words = explode(' ', preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str)));&lt;br /&gt; &lt;br /&gt; if (count($words) &lt;= $n)&lt;br /&gt; {&lt;br /&gt;  return $str;&lt;br /&gt; }&lt;br /&gt;   &lt;br /&gt; $str = '';&lt;br /&gt; for ($i = 0; $i &lt; $n; $i++)&lt;br /&gt; {&lt;br /&gt;  $str .= $words[$i].' ';&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return trim($str).$end_char;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(10) PHP limit characters&lt;br /&gt;&lt;br /&gt;function character_limiter($str, $n = 500, $end_char = '&amp;#8230;')&lt;br /&gt;{&lt;br /&gt; if (strlen($str) &lt; $n)&lt;br /&gt; {&lt;br /&gt;  return $str;&lt;br /&gt; }&lt;br /&gt;  &lt;br /&gt; $str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str));&lt;br /&gt;&lt;br /&gt; if (strlen($str) &lt;= $n)&lt;br /&gt; {&lt;br /&gt;  return $str;&lt;br /&gt; }&lt;br /&gt;         &lt;br /&gt; $out = "";&lt;br /&gt; foreach (explode(' ', trim($str)) as $val)&lt;br /&gt; {&lt;br /&gt;  $out .= $val.' ';   &lt;br /&gt;  if (strlen($out) &gt;= $n)&lt;br /&gt;  {&lt;br /&gt;   return trim($out).$end_char;&lt;br /&gt;  }  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;(11) Show page queries&lt;br /&gt;&lt;br /&gt;function mysql_query_2($query){&lt;br /&gt;$_SESSION['queries']++;&lt;br /&gt;return mysql_query($query);&lt;br /&gt;&lt;br /&gt;// now use mysql_query_2() function in place of mysql_query()&lt;br /&gt;// Each query will execute exactly the same but count up in&lt;br /&gt;// session variable 'queries'&lt;br /&gt;&lt;br /&gt;echo "$_SESSION['queries']";&lt;br /&gt;&lt;br /&gt;// just output it somewhere like above...&lt;br /&gt;&lt;br /&gt;(12) Checks if a path is absolute or relative&lt;br /&gt;&lt;br /&gt;function is_absolute($path)&lt;br /&gt;{&lt;br /&gt; return ($path[0] == '/' || (substr(PHP_OS, 0, 3) == 'WIN' &amp;&amp; preg_match('#^[a-z]:/#i', $path))) ? true : false;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-516589571855089583?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/516589571855089583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=516589571855089583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/516589571855089583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/516589571855089583'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/09/important-scrips-for-php-part-1.html' title='important scrips for php (Part -1)'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-3581747867912595696</id><published>2009-08-26T22:28:00.000-07:00</published><updated>2009-08-26T22:34:37.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Remove Leading Zeros Using PHP</title><content type='html'>It is actually two way to remove unnecessary Zeros&lt;br /&gt;&lt;br /&gt;(1) ltrim()&lt;br /&gt;&lt;br /&gt;    Example : echo ltrim(”001″,”0″);&lt;br /&gt;    Result  : 1&lt;br /&gt;&lt;br /&gt;(2) intval()&lt;br /&gt;  &lt;br /&gt;    Example : echo intval(”001″); &lt;br /&gt;    Result  : 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-3581747867912595696?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/3581747867912595696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=3581747867912595696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3581747867912595696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3581747867912595696'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/08/remove-leading-zeros-using-php.html' title='Remove Leading Zeros Using PHP'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-3076052090997746428</id><published>2009-08-26T22:03:00.000-07:00</published><updated>2010-08-20T21:15:05.428-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Conversion of MySQL Timestamp and DateTime to Unix based TimeStamp</title><content type='html'>About MySQL TimeStamp&lt;br /&gt;&lt;br /&gt;* The Prior version of MySQL v4.1 the timestamp was formatted as like YYYYMMDDHHMMSS”&lt;br /&gt;* since after MySQL v4.1 timestamp and datetime data types are formatted “YYYY-MM-DD HH:MM:SS”.&lt;br /&gt;&lt;br /&gt;About Unix Based TimeStamp&lt;br /&gt;&lt;br /&gt;* It is differ from MySQL. Unix’s timestamp is a integer value of seconds since January 1, 1970.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How To - Convert&lt;br /&gt;&lt;br /&gt;(1) Using MySQL &lt;br /&gt;&lt;br /&gt;     * you can use Unix_Timestamp() function.&lt;br /&gt;     * Example: &lt;br /&gt;                SELECT Unix_Timestamp(Created) FROM CreatedItem;&lt;br /&gt;&lt;br /&gt;(2) Using PHP &lt;br /&gt;     * you can use strtotime() function.&lt;br /&gt;     * Example: &lt;br /&gt;                $unixTimeStamp = strtotime($createdTimestamp);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-3076052090997746428?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/3076052090997746428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=3076052090997746428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3076052090997746428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/3076052090997746428'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/08/conversion-of-mysql-timestamp-and.html' title='Conversion of MySQL Timestamp and DateTime to Unix based TimeStamp'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-7814674280269160356</id><published>2009-07-31T05:36:00.000-07:00</published><updated>2009-07-31T05:42:14.177-07:00</updated><title type='text'>stdClass in php</title><content type='html'>stdClass is php's generic empty class or say default PHP object which has no predefined members, kind of like Object in Java&lt;br /&gt;you cannot define a class named stdClass in your PHP code. Useful for anonymous objects, dynamic properties,&lt;br /&gt;&lt;br /&gt;StdClass object creation.  Something like this would be great:&lt;br /&gt;&lt;br /&gt;$foo = {”bar”: “baz”, “bam”: “boom”};&lt;br /&gt;&lt;br /&gt;so you end up doing something like this:&lt;br /&gt;&lt;br /&gt;$foo = new StdClass;&lt;br /&gt;$foo-&gt;bar = “baz”;&lt;br /&gt;$foo-&gt;bam = “boom”;&lt;br /&gt;&lt;br /&gt;but you don’t have to.  Using PHP’s casting operator you can create the object in one line:&lt;br /&gt;$foo = (object) array(”bar” =&gt; “baz”, “bam” =&gt; “boom”);&lt;br /&gt;&lt;br /&gt;usage is casting an array to an object which takes each value in the array and adds it as a member variable with the name based on the key&lt;br /&gt;in the array.&lt;br /&gt;&lt;br /&gt;Here’s an example below that converts an array to an object below. This method is called Type Casting&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;'Divyesh',&lt;br /&gt;  'lastname' =&gt; 'Karelia'&lt;br /&gt; );&lt;br /&gt;&lt;br /&gt; $p = (object) $person;&lt;br /&gt; echo $p-&gt;firstname; // Will print 'Divyesh'&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here’s an example below that converts a multi-dimensional array to an object. This is accomplished through recursion.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;?&lt;br /&gt;02.function arrayToObject($array) {&lt;br /&gt;03.    if(!is_array($array)) {&lt;br /&gt;04.        return $array;&lt;br /&gt;05.    }&lt;br /&gt;06.    &lt;br /&gt;07.    $object = new stdClass();&lt;br /&gt;08.    if (is_array($array) &amp;&amp; count($array) &gt; 0) {&lt;br /&gt;09.      foreach ($array as $name=&gt;$value) {&lt;br /&gt;10.         $name = strtolower(trim($name));&lt;br /&gt;11.         if (!empty($name)) {&lt;br /&gt;12.            $object-&gt;$name = arrayToObject($value);&lt;br /&gt;13.         }&lt;br /&gt;14.      }&lt;br /&gt;15.      return $object;&lt;br /&gt;16.    }&lt;br /&gt;17.    else {&lt;br /&gt;18.      return FALSE;&lt;br /&gt;19.    }&lt;br /&gt;20.}&lt;br /&gt;21.?&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;array('name' =&gt; 'Divyesh'),&lt;br /&gt;  'last' =&gt;  array('name' =&gt; 'Karelia')&lt;br /&gt;  '&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;$p = arrayToObject($person);&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;first-&gt;name; // Will print 'Divyesh'&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-7814674280269160356?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/7814674280269160356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=7814674280269160356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7814674280269160356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7814674280269160356'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/07/stdclass-in-php.html' title='stdClass in php'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-7543030621991634275</id><published>2009-07-22T22:01:00.001-07:00</published><updated>2009-07-22T22:07:34.183-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.module'/><category scheme='http://www.blogger.com/atom/ns#' term='coloring syntax'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><title type='text'>Drupal .module extension treate as php file (syntax color) in Eclipse</title><content type='html'>Recently I started to work in Drupal. I came across strange little problem with Drupal’s module development, syntax coloring and general PHP support when it comes to files with extension different than .php or .phtml. Lucky for me, &lt;br /&gt;&lt;br /&gt;Eclipse comes with a nice solution for these kind of situations.&lt;br /&gt;&lt;br /&gt;All you need to do in order for Eclipse to treat .module extensions as .php is to go to &lt;br /&gt;&lt;br /&gt;Window Menu &gt; Preferences &gt; General &gt; Content Types &gt; (Select) Text &gt; PHP Content TYpe from the Content types area, then below under &lt;br /&gt;&lt;br /&gt;File Associations click on Add button and write down any extension you wish. In Drupal CMS case, write down “.module”.&lt;br /&gt;&lt;br /&gt;Now you should be able to work with .module files as with all other .php files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-7543030621991634275?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/7543030621991634275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=7543030621991634275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7543030621991634275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/7543030621991634275'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/07/drupal-module-extension-treate-as-php.html' title='Drupal .module extension treate as php file (syntax color) in Eclipse'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-4615187670264167896</id><published>2009-04-21T02:34:00.000-07:00</published><updated>2009-04-21T02:43:45.210-07:00</updated><title type='text'>Top 10 Drupal Modules</title><content type='html'>Every CMS system should have a rich variety of extensions and add-ons, and so does Drupal have. In Paul Koura (webpodge.com) has made a top 10 list of those modules that he finds most valuable for Drupal.&lt;br /&gt;&lt;br /&gt;His list is as shown below, in priority order:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Content Construction Kit" href="http://drupal.org/project/cck"&gt;Content Construction Kit&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Views" href="http://drupal.org/project/views"&gt;Views&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Tagadelic " href="http://drupal.org/project/tagadelic"&gt;Tagadelic&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Path and Pathauto" href="http://drupal.org/project/pathauto"&gt;Path and Pathauto&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Organic Groups" href="http://drupal.org/project/og"&gt;Organic Groups&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Buddylist" href="http://drupal.org/project/buddylist"&gt;Buddylist&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Privatemsg" href="http://drupal.org/project/privatemsg"&gt;Privatemsg&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Guestbook" href="http://drupal.org/project/guestbook"&gt;Guestbook&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Logintoboggan" href="http://drupal.org/project/logintoboggan"&gt;Logintoboggan&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a target="_blank" title="Service Links" href="http://drupal.org/project/service_links"&gt;Service Links&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;You can read Paul Koura's blog post including comments about each module here:&lt;br /&gt;&lt;a target="_blank" title="Top 10 Drupal Modules" href="http://webpodge.com/2007/02/22/top-10-drupal-modules/"&gt;http://webpodge.com/2007/02/22/top-10-drupal-modules/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-4615187670264167896?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/4615187670264167896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=4615187670264167896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4615187670264167896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4615187670264167896'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/04/top-10-drupal-modules.html' title='Top 10 Drupal Modules'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-8681450508505291156</id><published>2009-04-16T00:30:00.000-07:00</published><updated>2009-04-16T00:31:47.471-07:00</updated><title type='text'>Easy to under standing File Upload in PHP</title><content type='html'>see simple tutorial how to upload file in php&lt;br /&gt;&lt;br /&gt;http://www.sebastiansulinski.co.uk/web_design_tutorials/php/php_file_upload.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-8681450508505291156?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/8681450508505291156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=8681450508505291156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8681450508505291156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/8681450508505291156'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/04/easy-to-under-standing-file-upload-in.html' title='Easy to under standing File Upload in PHP'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-6188853507556407016</id><published>2009-04-16T00:21:00.000-07:00</published><updated>2009-04-16T00:26:18.770-07:00</updated><title type='text'>change the PHP Max Upload file size</title><content type='html'>Last 2 yeara ago, I made a php-upload code for www.blemo.com, this site is specialy for mp3 sound and image gallary, regardings to this functionality user can upload multiple mp3 sound file at a time. that time I did not know about file uplode limit and it's setting&lt;br /&gt;I tried much but some of file uploded and some of not for multipul file upload.&lt;br /&gt;&lt;br /&gt;search some solution for that.&lt;br /&gt;&lt;br /&gt;Most of the web servers are configured such a way that a user can only upload the maximum file size of 2MB.anything more will yield an error 500 due to a timeout. So there might be the problem for the people who wants to upload the .media file of size around 15MB. But, you can increse the maximum upload file size limit describe below.&lt;br /&gt;&lt;br /&gt;There are two ways (that I know of) to change the php upload limit.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;(1) changes in php.ini&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first is done by editing the php.ini file. This is normally the case if you have your own dedicated or virtual server. There may be multiple php.ini files throughout your system. The main one is typically found in /etc/php.ini which would govern all PHP. scripts.Furthermore you can include php.ini file in each folder that you wish to apply different settings to. In any case the, below are the fields you want to change.&lt;br /&gt;&lt;br /&gt;upload_max_filesize = 10M ;&lt;br /&gt;post_max_size = 20M ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;(2) by .htaccess&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An alternative is to using the php.ini file is to use .htaccess. By just placing a.htaccess file in your root folder. the following directive would be placed in .htaccess file&lt;br /&gt;&lt;br /&gt;RewriteEngine On&lt;br /&gt;php_value post_max_size 20M&lt;br /&gt;php_value upload_max_filesize 10M&lt;br /&gt;php_value max_execution_time 6000000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remember that : Choose your values carefully, know your audience and monitor the number of users. Always test/plan for worst case scenarios; 500 users uploading 10mb at the same time = 5,000mb bandwidth. This could easily annoy your web host provider.&lt;br /&gt;&lt;br /&gt;If you are on windows with IIS server .htaccess file will not work for you,You should update these settings in php.ini file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-6188853507556407016?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/6188853507556407016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=6188853507556407016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6188853507556407016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6188853507556407016'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/04/change-php-max-upload-file-size.html' title='change the PHP Max Upload file size'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-2573712943939148382</id><published>2009-04-14T01:52:00.000-07:00</published><updated>2009-04-14T01:56:00.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP OpenSource MySQL'/><title type='text'>Advantages of PHP Programming</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.eninteractive.com/images/icon-webdev-php.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 80px; height: 80px;" src="http://www.eninteractive.com/images/icon-webdev-php.gif" border="0" alt="" /&gt;&lt;/a&gt;PHP programming which had a humble beginning has now turned to be a major player in software development. It was successful in launching fast and simple scripting language that could work seamlessly with many other components.&lt;br /&gt;&lt;br /&gt;The execution speed of a web applications is very important as it cannot afford to slow down the rest of the machine, either. PHP integrates well with other software, especially under UNIX. It can be very fast, because it is a thin wrapper around many operating system calls.&lt;br /&gt;&lt;br /&gt;PHP offers various security levels which can be set in the .ini file to defend the system from attacks of users, both as programmers and as surfers.&lt;br /&gt;&lt;br /&gt;Another important advantage of PHP is its simplicity. Even HTML coders can integrate PHP programming straight into their pages.&lt;br /&gt;&lt;br /&gt;Further Advantages of PHP Programming include:&lt;br /&gt;&lt;br /&gt;    * Ease of writing interfaces to other libraries.&lt;br /&gt;    * Several HTTP server interfaces.&lt;br /&gt;    * Large amount of database interfaces like MySQL, MS SQL, Oracle, Informix, and PostgreSQL etc.&lt;br /&gt;    * PHP programming is similar to C / JavaScript and Java.&lt;br /&gt;    * PHP is extendible.&lt;br /&gt;    * PHP will run on (almost) any platform.&lt;br /&gt;    * The PHP Extension and Add-on Repository.&lt;br /&gt;    * PHP is Open Source.&lt;br /&gt;&lt;br /&gt;Reference from : http://www.eninteractive.com/Offshore-Outsourcing/Web-Application-Development/Programming/PHP-Advantages&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-2573712943939148382?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/2573712943939148382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=2573712943939148382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2573712943939148382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2573712943939148382'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/04/advantages-of-php-programming.html' title='Advantages of PHP Programming'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-2168889658544223499</id><published>2009-03-31T01:43:00.001-07:00</published><updated>2009-03-31T01:58:04.983-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vps'/><title type='text'>Different types of WebHosting</title><content type='html'>Hosting can be FREE, SHARED or DEDICATED.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Free Hosting&lt;/h2&gt; &lt;p&gt; Some service providers offer free web hosting.&lt;/p&gt;  &lt;p&gt; Free web hosting is best suited for small sites with low traffic, like family  sites or sites about hobbies. It is not recommended for high traffic or for real business.  Technical support is often limited, and technical options are few.&lt;/p&gt;  &lt;p&gt; Very often you cannot use your own domain name at a free site. You have to use  a name provided by your host like http://www.freesite/users/~yoursite.htm.  This is hard to type, hard to remember, and not very  professional.&lt;/p&gt;&lt;table class="reference" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th width="50%"&gt;Good:&lt;/th&gt;     &lt;th width="50%"&gt;Bad:&lt;/th&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;Low cost. It's free.&lt;/td&gt;     &lt;td&gt;No domain names.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Good for family, hobby or personal sites.&lt;/td&gt;     &lt;td&gt;Few, limited, or no software options. &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Free email is often an option.&lt;/td&gt;     &lt;td&gt;Limited security options.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;td&gt;Limited or no database support.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;td&gt;Limited technical support.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;Shared (Virtual) Hosting&lt;/h2&gt;  &lt;p&gt;Shared hosting is very common, and very cost effective.&lt;/p&gt;  &lt;p&gt;With shared hosting, your web site is hosted on a powerful server along with  maybe 100 other web sites. On a shared host it is common that each web site have  their own domain name.&lt;/p&gt;  &lt;p&gt;Shared solutions often offer multiple software solutions like email,  database, and many different editing options. Technical support tends to be  good.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cost: &lt;/strong&gt;$15 per month.&lt;br /&gt;     &lt;strong&gt;Best for: &lt;/strong&gt;Small businesses who receive moderate levels of traffic.&lt;/p&gt;  &lt;table class="reference" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;     &lt;tbody&gt;&lt;tr&gt;     &lt;th width="50%"&gt;Good:&lt;/th&gt;     &lt;th width="50%"&gt;Bad:&lt;/th&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;Low cost. Cost is shared with others.&lt;/td&gt;     &lt;td&gt;Reduced security due to many sites on one server.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Good for small business and average traffic.&lt;/td&gt;     &lt;td&gt;Restrictions on traffic volume.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Multiple software options.&lt;/td&gt;     &lt;td&gt;Restricted database support.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Own domain name.&lt;/td&gt;     &lt;td&gt;Restricted software support.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Good support&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr /&gt;  &lt;h2&gt;&lt;strong&gt;VPS hosting&lt;/strong&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;&lt;p&gt;VPS (Virtual private server also referred to as &lt;b&gt;Virtual Dedicated Server&lt;/b&gt; or &lt;b&gt;VDS&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) hosting is a great stepping stone between shared and dedicated hosting. A single physical server is partitioned into multiple virtual private servers, and each VPS gets a dedicated amount of CPU and memory resources. Therefore, even if a VPS on the same server crashes, your VPS won't suffer. Also, a VPS gives you more control over server, software, and security configuration than shared hosting.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;Cost:&lt;/strong&gt; $60- $100 per month.&lt;br /&gt;&lt;strong&gt;Best for:&lt;/strong&gt; Small and medium businesses who need special server configuration and secure eCommerce capabilities.&lt;/span&gt;                     &lt;/h2&gt;&lt;h2&gt;Dedicated Hosting&lt;/h2&gt;  &lt;p&gt;With dedicated hosting your web site is hosted on a dedicated server.&lt;/p&gt;  &lt;p&gt;Dedicated hosting is the most expensive form of hosting. The solution is best  suited for large web sites with high traffic, and web sites that use special  software. &lt;/p&gt;  &lt;p&gt;You should expect dedicated hosting to be very powerful and secure, with  almost unlimited software solutions.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; starting at $150 per month&lt;br /&gt;     &lt;strong&gt;Best for: &lt;/strong&gt;Companies who  outgrow  VPS hosting, or new companies who have the need and budget.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;  &lt;table class="reference" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;     &lt;tbody&gt;&lt;tr&gt;     &lt;th width="50%"&gt;Good:&lt;/th&gt;     &lt;th width="50%"&gt;Bad:&lt;/th&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;Good for large business.&lt;/td&gt;     &lt;td&gt;Expensive.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;Good for high traffic.&lt;/td&gt;     &lt;td&gt;Requires higher skills.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Multiple domain names.&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Powerful email solutions.&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Powerful database support.&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Strong (unlimited) software support.&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr /&gt; &lt;h2&gt;Collocated Hosting&lt;/h2&gt; &lt;p&gt;Collocation means "co-location". It is a solution that lets you place  (locate) your own web server on the premises (locations) of a service provider.&lt;/p&gt; &lt;p&gt;This is pretty much the same as running your own server in your own office,  only that it is located at a place better designed for it.&lt;/p&gt; &lt;p&gt;Most likely a provider will have dedicated resources like high-security  against fire and vandalism, regulated backup power, dedicated Internet  connections and more.&lt;/p&gt;  &lt;table class="reference" border="1" cellpadding="0" cellspacing="0" width="100%"&gt;     &lt;tbody&gt;&lt;tr&gt;     &lt;th width="50%"&gt;Good:&lt;/th&gt;     &lt;th width="50%"&gt;Bad:&lt;/th&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;High bandwidth.&lt;/td&gt;     &lt;td&gt;Expensive.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;     &lt;td&gt;High up-time.&lt;/td&gt;     &lt;td&gt;Requires higher skills.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;High security.&lt;/td&gt;     &lt;td&gt;Harder to configure and debug.&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;     &lt;td&gt;Unlimited software options.&lt;/td&gt;     &lt;td&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr /&gt; &lt;h2&gt;Your Checklist&lt;/h2&gt; &lt;p&gt;Before you choose your web host, make sure that:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;The hosting type suits your current needs&lt;/li&gt;&lt;li&gt;The hosting type is cost effective&lt;/li&gt;&lt;li&gt;Upgrading to a better server is a possible solution&lt;/li&gt;&lt;li&gt;If needed, upgrading to a dedicated server is possible&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Before you sign up a contract with any hosting provider, surf some other web  sites on their servers, and try to get a good feeling about their network speed.  Also compare the other sites against yours, to see if it looks like you have the  same needs. Contacting some of the other customers is also a valuable option.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-2168889658544223499?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/2168889658544223499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=2168889658544223499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2168889658544223499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2168889658544223499'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/03/different-types-of-webhosting.html' title='Different types of WebHosting'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-4778257866189882152</id><published>2009-03-26T00:05:00.000-07:00</published><updated>2009-03-26T01:51:05.569-07:00</updated><title type='text'>APACHE SERVER STATUS &amp; ERROR CODES</title><content type='html'>Sometimes when trying to access a web page, an error code will appear. Have you ever wondered what that code meant? Here is a list of the most popular error codes and their description. The first thing you should do anytime you get an error code is to make sure that you have entered the correct web page addressed. Everyone has incorrectly spelled a company name or added too many periods.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;401 - Authorization Required&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This error code means that you must have special access to view this page. The developers may want only certain people to access this page. There are several ways to limit access to a web page, including password protection. You may get the “401 - Authorization Required” error message when you try to view a web page with limited access. (A web site may have a customized version of this error message, displaying “Access Denied” or “Unavailable.”)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;403 - Forbidden&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This standard error message is generated by web servers when you try to access a file that has not been correctly configured by whomever maintains it. (The file needs to be set with “read permissions” for all users.) What this code most likely means is that you can’t view the page because whomever maintains the site set it up incorrectly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;404 - Page not found&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A 404 - Not Found error means that there was no web page with the name you specified at the web site. This could happen for a variety of reasons:&lt;br /&gt;Make sure that the web address (URL) that you typed in exactly matches the address you were given. Check that the capitalization matches, that all words are spelled properly, and that all the punctuation, like dots (.) and slashes (/), are correct. Be sure you are using the forward slash (/) and not the backward slash (\). (Remember, there are no spaces allowed in Web addresses, and a proper Web address will look like http://www.htmlcenter.com).&lt;br /&gt;The page may have been renamed, moved, or deleted. Another possibility is that the person maintaining the web page may no longer have an account at that location.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;500 - Page not available&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the server has been incorrectly set up or is experiencing technical problems, it will return this error. Again the first thing to do is make sure that you have typed in the address correctly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;501 - Not Implemented&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This error is a direct result of problems in the web page’s HTML (HyperText Markup Language). It usually occurs with web pages that contain forms in which you type information and send it to a third party.&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;table bgcolor="#ffffcc" border="0"&gt;&lt;br /&gt;   &lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;b&gt;Successful Client Requests&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;200&lt;/td&gt;&lt;td&gt; OK&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;201&lt;/td&gt;&lt;td&gt; Created&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;202&lt;/td&gt;&lt;td&gt; Accepted&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;203&lt;/td&gt;&lt;td&gt; Non-Authorative Information&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;204&lt;/td&gt;&lt;td&gt; No Content&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;205&lt;/td&gt;&lt;td&gt; Reset Content&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;206&lt;/td&gt;&lt;td&gt; Partial Content&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;b&gt;Client Request Redirected&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;300&lt;/td&gt;&lt;td&gt; Multiple Choices&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;301&lt;/td&gt;&lt;td&gt; Moved Permanently&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;302&lt;/td&gt;&lt;td&gt; Moved Temporarily&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;303&lt;/td&gt;&lt;td&gt; See Other&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;304&lt;/td&gt;&lt;td&gt; Not Modified&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;305&lt;/td&gt;&lt;td&gt; Use Proxy&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;b&gt;Client Request Errors&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;400&lt;/td&gt;&lt;td&gt; Bad Request&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;401&lt;/td&gt;&lt;td&gt; Authorization Required&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;402&lt;/td&gt;&lt;td&gt; Payment Required (not used yet)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;403&lt;/td&gt;&lt;td&gt; Forbidden&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;404&lt;/td&gt;&lt;td&gt; Not Found&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;405&lt;/td&gt;&lt;td&gt; Method Not Allowed&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;406&lt;/td&gt;&lt;td&gt; Not Acceptable (encoding)&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;407&lt;/td&gt;&lt;td&gt; Proxy Authentication Required&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;408&lt;/td&gt;&lt;td&gt; Request Timed Out&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;409&lt;/td&gt;&lt;td&gt; Conflicting Request&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;410&lt;/td&gt;&lt;td&gt; Gone&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;411&lt;/td&gt;&lt;td&gt; Content Length Required&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;412&lt;/td&gt;&lt;td&gt; Precondition Failed&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;413&lt;/td&gt;&lt;td&gt; Request Entity Too Long&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;414&lt;/td&gt;&lt;td&gt; Request URI Too Long&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;415&lt;/td&gt;&lt;td&gt; Unsupported Media Type&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td colspan="2" align="center"&gt;&lt;b&gt;Server Errors&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;500&lt;/td&gt;&lt;td&gt; Internal Server Error&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;501&lt;/td&gt;&lt;td&gt; Not Implemented&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;502&lt;/td&gt;&lt;td&gt; Bad Gateway&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;503&lt;/td&gt;&lt;td&gt; Service Unavailable&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;504&lt;/td&gt;&lt;td&gt; Gateway Timeout&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;   &lt;tr&gt;&lt;td&gt;505&lt;/td&gt;&lt;td&gt; HTTP Version Not Supported&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-4778257866189882152?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/4778257866189882152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=4778257866189882152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4778257866189882152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/4778257866189882152'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/03/apache-server-status-error-codes.html' title='APACHE SERVER STATUS &amp; ERROR CODES'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-1506024978712905789</id><published>2009-01-02T09:17:00.001-08:00</published><updated>2009-01-02T09:52:33.173-08:00</updated><title type='text'>Web 2.0 : What Is It?</title><content type='html'>&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td width="14%" valign="top"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BiThJX7sxNw/SV5O5cHDlII/AAAAAAAAABs/3zojA53SPYE/s1600-h/web-20-will-save-us.jpg" &gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 160px; height: 72px;" src="http://1.bp.blogspot.com/_BiThJX7sxNw/SV5O5cHDlII/AAAAAAAAABs/3zojA53SPYE/s320/web-20-will-save-us.jpg" alt="" id="BLOGGER_PHOTO_ID_5286749761284838530" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;br /&gt;    &lt;td width="86%" valign="top"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td colspan="2" valign="top"&gt;&lt;p&gt;The bursting of the dot-com bubble in the fall of 2001  marked a turning point for the web. Many people concluded that the web was  overhyped, There is no clear definition of web 2.0.&lt;/p&gt;&lt;br /&gt;      &lt;p&gt; The concept of &amp;quot;Web 2.0&amp;quot; began with a  conference brainstorming session between O'Reilly and MediaLive International (Web  2.0 conference ) held in San Francisco Oct 2004 but one thing is clear Web 2.0 marks a fundamental change in  how we use the Internet.&lt;/p&gt;&lt;br /&gt;      &lt;p&gt;&lt;strong&gt;Web 1.0&lt;/strong&gt;&lt;br&gt;&lt;br /&gt;Early Web development (retrospectively called as Web 1.0) &lt;strong&gt; &lt;/strong&gt;&lt;br&gt;&lt;br /&gt;Simply we  can say these : &lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp;  Static pages instead of dynamic user-generated content. &lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp;  The use of framesets. &lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp;  Proprietary HTML extensions such  as the &amp;lt;blink&amp;gt; and &amp;lt;marquee&amp;gt; tags introduced during the &lt;u&gt;first browser war&lt;/u&gt;. &lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp;  Online guestbooks. &lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp; GIF buttons, typically 88x31 pixels in size promoting web browsers and other  products.&lt;br&gt;&lt;br /&gt;&amp;middot;&amp;nbsp; HTML forms sent via email. A user would fill in a form, and upon  clicking submit their &lt;u&gt;email client&lt;/u&gt; would  attempt to send an email containing the form's details&lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;strong&gt;Web 2.0&lt;/strong&gt;&lt;br&gt;&lt;br /&gt;Network connectivity is the most fundamental principle for  Web 2.0 to succeed. Any collaboration amongst users is not possible without  being connected to each other.&lt;br&gt;&lt;br /&gt;There are a plethora of web sites emphasizing the social  aspects of Web 2.0 which was not prominent in Web 1.0.&lt;/p&gt;&lt;br /&gt;    &lt;p&gt;AJAX, CSS, RSS/Atom, Folksonomies, Blogs, Mashups and REST are some of the main technologies that enable the principles of Web  2.0. In the subsequent blog entries,&lt;br&gt;&lt;br /&gt;      (IMAGE)&lt;/p&gt;&lt;br /&gt;    &lt;p&gt;There is no clear-cut demarcation  between Web 2.0 and Web 1.0 technologies, hardware and applications. The  distinction is, to a large extent, subjective. Here are a few characteristics  often noted as descriptive of Web 2.0:&lt;/p&gt;&lt;br /&gt;    &lt;ul type="disc"&gt;&lt;br /&gt;      &lt;li&gt;blogging&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Ajax and other new technologies&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Google       Base and other free Web       services&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;RSS-generated syndication&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;social       bookmarking&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;mash-ups&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;wikis and other collaborative applications&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;dynamic as opposed to static site content&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;interactive encyclopedias and dictionaries&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;ease of data creation, modification or deletion by       individual users&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;advanced gaming.&lt;/li&gt;&lt;br /&gt;    &lt;/ul&gt;&lt;br /&gt;    &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;    &lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;ldquo;collection of technologies - be it VoIP,  Digital Media, XML, RSS, Google Maps&amp;hellip; whatever &amp;hellip; that leverage the power of  always on, high speed connections and treat broadband as a platform, and not  just a pipe to connect.&amp;rdquo;&lt;/strong&gt;&lt;br&gt;&lt;br /&gt;      That is easy (few minutes learning curve), quick (intuitive)  and effective (presentable). &lt;a href="http://flickr.com"&gt;Flickr&lt;/a&gt;, &lt;a href="http://wikipedia.org"&gt;Wikipedia&lt;/a&gt;, &lt;a href="http://myspace.com"&gt;MySpace&lt;/a&gt;, &lt;a href="http://docs.google.com"&gt;Writely&lt;/a&gt;, &lt;a href="http://del.icio.us/"&gt;Del.icio.us&lt;/a&gt; and &lt;a href="http://youtube.com"&gt;YouTube&lt;/a&gt; are some of the most common (and  successful) websites showing Web 2.0 concepts. Most of these websites have  gained popularity in past 1.5 years but it's hard to imagine life before them. &lt;br&gt;&lt;br /&gt;      Web 2.0 era is the rise of blogging. Personal home pages  have been around since the early days of the web, and the personal diary and  daily opinion column around much longer than that,&lt;br&gt;&lt;br /&gt;  &amp;amp; internet era software is that it is delivered as a  service, not as a product.&lt;br&gt;&lt;br /&gt;    Netscape was the standard bearer for Web 1.0, Google is most  certainly the standard bearer for Web 2.0,&lt;/p&gt;    &lt;br /&gt;    &lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;   &lt;td&gt;&lt;table border="0" cellspacing="0" cellpadding="0" width="500"&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td width="200"&gt;&lt;p align="right"&gt;&lt;strong&gt;Web    1.0&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td width="59"&gt;&lt;p align="center"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td width="241"&gt;&lt;p&gt;&lt;strong&gt;Web 2.0&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;DoubleClick&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;Google AdSense &lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;Ofoto&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;Flickr&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;Akamai&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;BitTorrent&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;mp3.com&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;Napster&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;Britannica    Online&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;Wikipedia&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;personal    websites&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;blogging&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;evite&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;upcoming.org and EVDB&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;domain    name speculation&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;search engine optimization&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;page    views&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;cost per click&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;screen    scraping&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;web services&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;publishing&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;participation&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;content    management systems&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;wikis&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;directories    (taxonomy)&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;tagging (&amp;quot;folksonomy&amp;quot;)&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="right"&gt;stickiness&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p align="center"&gt;--&amp;gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;        &lt;td&gt;&lt;p&gt;syndication&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;    &lt;/table&gt;&lt;br /&gt;    &lt;p&gt;we believe to be the core  competencies of Web 2.0 companies:&lt;/p&gt;&lt;br /&gt;    &lt;ul type="disc"&gt;&lt;br /&gt;      &lt;li&gt;Services, not packaged software, with cost-effective       scalability&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Control over unique, hard-to-recreate data sources that       get richer as more people use them&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Trusting users as co-developers&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Harnessing collective intelligence&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Leveraging the long tail through customer self-service&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Software above the level of a single device&lt;/li&gt;&lt;br /&gt;      &lt;li&gt;Lightweight user interfaces, development models, AND       business models&lt;/li&gt;&lt;br /&gt;    &lt;/ul&gt;&lt;br /&gt;    &lt;p&gt;That is easy (few minutes learning curve), quick (intuitive)  and effective (presentable). &lt;a href="http://flickr.com"&gt;Flickr&lt;/a&gt;, &lt;a href="http://wikipedia.org"&gt;Wikipedia&lt;/a&gt;, &lt;a href="http://myspace.com"&gt;MySpace&lt;/a&gt;, &lt;a href="http://docs.google.com"&gt;Writely&lt;/a&gt;, &lt;a href="http://del.icio.us/"&gt;Del.icio.us&lt;/a&gt; and &lt;a href="http://youtube.com"&gt;YouTube&lt;/a&gt; are some of the most common (and  successful) websites showing Web 2.0 concepts. Most of these websites have  gained popularity in past 1.5 years but it's hard to imagine life before them. &lt;/p&gt;&lt;br /&gt;    &lt;p&gt;The idea of sharing information is being valued as much as  the idea of proprietary information. &lt;a href="http://webtrends.about.com/od/glossary/g/opensource_def.htm"&gt;Open source&lt;/a&gt;,  which has been around for decades, is becoming a significant factor. And the  web link is becoming a form of currency.&lt;/p&gt;    &lt;br /&gt;    &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;      &lt;h2&gt; Web 2.0 vs Web 1.0     &amp;nbsp;&amp;nbsp;From &lt;a href='http://joedrumgoole.com/blog/2006/05/29/web-20-vs-web-10/'&gt;Joe Drumgoole&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;      &lt;ul&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about reading, Web 2.0 is about writing&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about companies, Web 2.0 is about communities&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about client-server, Web 2.0 is about peer to peer&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about HTML, Web 2.0 is about XML&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about home pages, Web 2.0 is about blogs&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about portals, Web 2.0 is about RSS&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about taxonomy, Web 2.0 is about tags&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about wires, Web 2.0 is about wireless&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about owning, Web 2.0 is about sharing&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about IPOs, Web 2.0 is about trade sales&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about Netscape, Web 2.0 is about Google&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about web forms, Web 2.0 is about web applications&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about screen scraping, Web 2.0 is about APIs&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about dialup, Web 2.0 is about broadband&lt;/li&gt;&lt;br /&gt;        &lt;li&gt;Web 1.0 was about hardware costs, Web 2.0 is about bandwidth costs&lt;/li&gt;&lt;br /&gt;      &lt;/ul&gt;&lt;br /&gt;    &lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-1506024978712905789?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/1506024978712905789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=1506024978712905789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1506024978712905789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/1506024978712905789'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/01/web-20-what-is-it.html' title='Web 2.0 : What Is It?'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_BiThJX7sxNw/SV5O5cHDlII/AAAAAAAAABs/3zojA53SPYE/s72-c/web-20-will-save-us.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-6436088401890951963</id><published>2009-01-01T09:30:00.000-08:00</published><updated>2009-01-01T09:31:19.201-08:00</updated><title type='text'>40 Tips for Optimizing PHP performance</title><content type='html'>&lt;p&gt;Reinhold Weber has written &lt;a href="http://reinholdweber.com/?p=3"&gt;&lt;strong&gt;40 Tips for Optimizing PHP performance&lt;/strong&gt;&lt;/a&gt;. Many of them were new to me - e.g. $row['id'] is 7 times faster than $row[id]. I don’t know how he has measured these numbers, but the tips are good overall!&lt;/p&gt; &lt;p&gt;Here are the first 10 tips:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;If a method can be static, declare it static. Speed improvement is by a factor of 4.&lt;/li&gt;&lt;li&gt;echo is faster than print.&lt;/li&gt;&lt;li&gt;Use echo’s multiple parameters instead of string concatenation.&lt;/li&gt;&lt;li&gt;Set the maxvalue for your for-loops before and not in the loop.&lt;/li&gt;&lt;li&gt;Unset your variables to free memory, especially large arrays.&lt;/li&gt;&lt;li&gt;Avoid magic like __get, __set, __autoload&lt;/li&gt;&lt;li&gt;require_once() is expensive&lt;/li&gt;&lt;li&gt;Use full paths in includes and requires, less time spent on resolving the OS paths.&lt;/li&gt;&lt;li&gt;If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()&lt;/li&gt;&lt;li&gt;See if you can use strncasecmp, strpbrk and stripos instead of regex&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;&lt;a href="http://reinholdweber.com/?p=3"&gt;Read the full list of 40 tips here.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Read comments on the post as well, they too contain useful information.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-6436088401890951963?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/6436088401890951963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=6436088401890951963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6436088401890951963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/6436088401890951963'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2009/01/40-tips-for-optimizing-php-performance.html' title='40 Tips for Optimizing PHP performance'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-2388277912030081296</id><published>2008-12-18T06:46:00.001-08:00</published><updated>2008-12-18T06:51:29.257-08:00</updated><title type='text'>101 Reasons Why Java is Better than .NET</title><content type='html'>&lt;p&gt;you migrate to a superior Java platform .&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: bold;"&gt;1&lt;/span&gt;. Public Domain APIs - Any Java public apis are part of the public domain, .NET apis are proprietary and can open the door to a law suit.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2&lt;/span&gt;. Standard Library Source Code Availability - Java source code for the core libraries are available in every J2SDK distribution, .NET sources can only be seen by resorting to illegal means.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3&lt;/span&gt;. dotNet Purity Is A Myth - Java promotes 100% pure Java libraries, for .NET purity is nothing more than a myth.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4&lt;/span&gt;. 75% Of Enterprise Software Development - Avoid becoming one of the 25% of "use-less" employees.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5&lt;/span&gt;. Preferred Platform for Implementing WebServices - Despite billions spent by Microsoft in marketing, surveys &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;A Java keyword used to resume program execution at the end of the current loop. If followed by a label, continue resumes execution where the label occurs. &lt;/p&gt;', CAPTION, 'continue',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;continue&lt;/a&gt; to reveal that Java is the preferred platform when it comes to Web Services.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6&lt;/span&gt;. Superior Platform for Web Development - ASP.NET is a poorly designed and crippled framework as compared to the richness of frameworks found in Java.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7&lt;/span&gt;. Write Stored Procedures using Java - Most relational databases support writing of stored procedures in the Java language. There has yet to be a production release of a database that supports any .NET languages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8&lt;/span&gt;. An Abundance of Experienced Practitioners - Nobody seems to know how to write .NET programs well and that's giving .NET a bad name! A pretty lame excuse I must say!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9&lt;/span&gt;. Supportive Open Source Communities - Open Source communities that support &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;Running in more than one address space. &lt;/p&gt;', CAPTION, 'distributed',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;distributed&lt;/a&gt; development are a plenty in the Java world.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10&lt;/span&gt;. Proven Security - 2 Years after Trust Worthy initiative is launched and we collectively lose $55 billion last year.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;11&lt;/span&gt;. No Lizard Brain - .NET programmers continue to struggle with the complexities of a hybrid managed/unmanaged environment.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;12&lt;/span&gt;. More Languages - The JVM is more "common" than the CLR.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;13&lt;/span&gt;. Smaller Runtime Download - You can't run your app if you don't have the runtime.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;14&lt;/span&gt;. No Mandatory Upgrade Fees - 3 things a Microsoft shop can't avoid: Death, Taxes and License 6.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;15&lt;/span&gt;. More Vendor Choices - .Net is a marketing program. Java is a Market.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;16&lt;/span&gt;. Industrial Strength Collection Classes - The .Net libraries look like they were designed by high-school students, First year CompSci? students at best.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;17&lt;/span&gt;. FutureProof - The way to ensure your return on investment (i.e. ROI) is that your choice of platform doesn't get obsolete in 5 or even 10 years. Avoid the Microsoft upgrade treadmill!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;18&lt;/span&gt;. Larger Talent Pool - Majority of Universities not only teach but require knowledge of Java. That's a big talent pool that you need to consider before you off-shore your project to a different time-zone.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;19&lt;/span&gt;. More Contributions From Researchers - Research institutions and universities have consistently provided innovative research not only built on top of Java but also contributing to Java.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;20&lt;/span&gt;. US Government Approved - Guess where the billions of dollars spent on the U.S. government's IT renovation is going to?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;21&lt;/span&gt;. NoEvilTypeCoercion - Some C++ constructs are meant to be entombed forever, .NET resurrects them with disastrous consquences.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;22&lt;/span&gt;. More Mature And Robust O/R Mapping - You can't beat the wealth of O/R mapping solutions found in Java.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;23&lt;/span&gt;. Superior Coding Tools - Like having your own personal Java fairy dancing through your code, anticipating your every thought and keystroke.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;24&lt;/span&gt;. Sane Coding Conventions - I don't know what's worse Hungarian notation or .NET coding conventions.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;25&lt;/span&gt;. Higher Paying Jobs - Somehow you've got to afford those skyrocketing housing prices don't you?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;26&lt;/span&gt;. Favored for Implementing P2P - Gnutella and JXTA, anything &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;A Java keyword used to execute a block of statements in the case that the test condition with the if keyword evaluates to false. &lt;/p&gt;', CAPTION, 'else',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;else&lt;/a&gt; legally more pervasive?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;27&lt;/span&gt;. PureJavaRDMS - Can't beat the ease of installation when the RDMS is Java based and packaged with the application in a .zip file.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;28&lt;/span&gt;. More &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;An event during program execution that prevents the program from continuing normally; generally, an error. The Java programming language supports exceptions with the try, catch, and throw keywords.&lt;/p&gt;', CAPTION, 'exception',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;exception&lt;/a&gt; Handling Options - .NET has no analog to the throws clause in &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;A function defined in a class. &lt;/p&gt;', CAPTION, 'method',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;method&lt;/a&gt; signatures.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;29&lt;/span&gt;. Better Structured Diagramming Frameworks - When going beyond forms and windows, Java can't be beat.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;30&lt;/span&gt;. Reusable Open Source IDE Frameworks - Why re-invent the wheel? Start building your killer &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;Graphical User Interface. Refers to the techniques involved in using graphics, along with a keyboard and a mouse, to provide an easy-to-use interface to some program. &lt;/p&gt;', CAPTION, 'GUI',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;GUI&lt;/a&gt; application on top of killer IDE frameworks.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;31&lt;/span&gt;. RobustParserGenerators - Want to build a &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;A Java keyword used to create an instance of a class. &lt;/p&gt;', CAPTION, 'new',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;new&lt;/a&gt; language, well you'll need some robust parser building tools.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;32&lt;/span&gt;. AspectOrientedProgramming - The next advance in modular software development, get a head start by using Java.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;33&lt;/span&gt;. PureJavaWebServers - Customizations and extensions are easier in a web container that's built using the same language as applications. Furthermore, managed environments support better reliability and security.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;34&lt;/span&gt;. OpenSourceJavaCompilers - Your tools have got to be able to parse the code before it has any chance in understanding it.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;35&lt;/span&gt;. Distributed Caching - Sometimes embarassingly parallel applications aren't the only things that you need to scale.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;36&lt;/span&gt;. MultipleReliableMessagingChoices - Java provides more choices for the backbone that integrates the Enterprise.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;37&lt;/span&gt;. Faster Development Turnaround - Incremental compilation is unavailable in the .NET environment.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;38&lt;/span&gt;. Lightweight Persistence - Sometimes a relational database (RDMS) has too big a footprint.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;39&lt;/span&gt;. Open Community Process - How does one contribute to the specification of standards?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;40&lt;/span&gt;. Hardware Accelerators - Performance boosting hardware.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;41&lt;/span&gt;. More Flexible Licensing Options - Ultimate flexibility in licensing.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;42&lt;/span&gt;. EmbeddedDevices - Java inside small packages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;43&lt;/span&gt;. Faster Virtual Machines -&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;44&lt;/span&gt;. MickrokernelArchitectures&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;45&lt;/span&gt;. ContinuousBuild&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;46&lt;/span&gt;. WholeProgramOptimization - Please sir may I have a linker?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;47&lt;/span&gt;. Comprehensive RDMS Driver Support - Can you find a ADO.NET driver for an open source database?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;48&lt;/span&gt;. Superior Code Analysis Tools&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;49&lt;/span&gt;. NetworkingSupport - Why is MSN managed by a Java based tool?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;50&lt;/span&gt;. More &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;The automatic detection and freeing of memory that is no longer in use. The Java runtime system performs garbage collection so that programmers never explicitly free objects. &lt;/p&gt;', CAPTION, 'garbage collection',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;garbage collection&lt;/a&gt; Options&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;51&lt;/span&gt;. ReliabilityConcerns&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;52&lt;/span&gt;. Better Web Services Interoperability&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;53&lt;/span&gt;. Better Domain Specific Languages Support&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;54&lt;/span&gt;. Painless Upgradability&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;55&lt;/span&gt;. Simple Side By Side Execution&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;56&lt;/span&gt;. More Business Rules Engines&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;57&lt;/span&gt;. Lightweight Containers&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;58&lt;/span&gt;. Better Business Process Management&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;59&lt;/span&gt;. Sixty Four &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;The smallest unit of information in a computer, with a value of either 0 or 1.&lt;/p&gt;', CAPTION, 'bit',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;bit&lt;/a&gt; Support&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;60&lt;/span&gt;. Millions Of Java Phones&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;61&lt;/span&gt;. Garbage Collect Classes - The only way to unload MSIL code is to unload an entire application domain.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;62&lt;/span&gt;. More Alternative VM Implementations&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;63&lt;/span&gt;. Hard Realtime Capabilities&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;64&lt;/span&gt;. Cross Platform Language Integration&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;65&lt;/span&gt;. More Extensive XML Support&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;66&lt;/span&gt;. Better Support For Dynamic Distributed Systems&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;67&lt;/span&gt;. Superior 2D Drawing&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;68&lt;/span&gt;. Better GUI Framework - Why isn't VS.NET written in a .NET language?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;69&lt;/span&gt;. SuperiorBranding&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;70&lt;/span&gt;. No Anti Open Source Agenda&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;71&lt;/span&gt;. Standardized Portal Frameworks - Standardized ""Integration at the glass"".&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;72&lt;/span&gt;. RunInIntepreterMode - ""We're just not optimized for interpreting""&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;73&lt;/span&gt;. More Semantic Web Research&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;74&lt;/span&gt;. Leads In Software Process Best Practices&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;75&lt;/span&gt;. Better Concurrency Utilities&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;76&lt;/span&gt;. More Multicasting Libraries&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;77&lt;/span&gt;. Superior Refactoring Tools&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;78&lt;/span&gt;. Higher Demand Therefore More Jobs&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;79&lt;/span&gt;. Faster And More Reliable Regex&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;80&lt;/span&gt;. SuperiorBuildEnvironments - A .NET practitioner's concept of a build is F7.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;81&lt;/span&gt;. Embarassingly Rich Information Sources&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;82&lt;/span&gt;. More Open Source Projects&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;83&lt;/span&gt;. Affordable Industrial Grade IDEs&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;84&lt;/span&gt;. Standardized Enterprise Connectivity&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;85&lt;/span&gt;. DynamicLanguagesSupport&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;86&lt;/span&gt;. MorePDASupport - Why limit oneself to a single PDA brand?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;87&lt;/span&gt;. OpenTechnologyRoadmap - .NET is like a five year plan in the former USSR: You know it doesn't actually make sense or help anything, but if you live under it, you're certainly not going to say anything negative about it.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;88&lt;/span&gt;. EmergingStandardsSupport&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;89&lt;/span&gt;. JavaCard - JavaCards? are becomming the preferred method of keeping tabs on your citizenry or customers. If Microsoft ever co-opts this technology then "1984" will become more than just a paperback novel.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;90&lt;/span&gt;. Complete Open Source Stack - Open Source code visibility spanning all layers of an application.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;91&lt;/span&gt;. NonStopServers - .NET not fault-tolerant enough for Hewlett-Packard-Compaq?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;92&lt;/span&gt;. Out Of This World - Java runs on other planets, .NET has yet to leave Terra Firma.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;93&lt;/span&gt;. Better Unit Testing Support - More extensions and comprehensive IDE support&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;94&lt;/span&gt;. More Identity Management Solutions - Can you trust Microsoft to keeping your customer's identity secure and available?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;95&lt;/span&gt;. Most UML Tools Implement In Java - Ever wonder why the best UML tools are implemented in Java?&lt;br /&gt;96. More R&amp;amp;D On Intelligent Agents - Java is the preferred implementation platform for Intelligent Agents.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;97&lt;/span&gt;. Easy Rich &lt;a class="mosinfopop" style="" href="javascript:void(0)" onmouseover=""&gt;In the client/server model of communications, the client is a process that remotely accesses resources of a compute server, such as compute power and large memory capacity.&lt;/p&gt;', CAPTION, 'client',BELOW,RIGHT, WIDTH, 300, FGCOLOR, '#CCCCFF', BGCOLOR, '#333399', TEXTCOLOR, '#000000', CAPCOLOR, '#FFFFFF', OFFSETX, 10, OFFSETY, 10);" onmouseout="return nd();"&gt;&lt;img src="http://www.brainjava.com/mambots/content/glossarbot/info.gif" align="top" border="0" /&gt;client&lt;/a&gt; Deployment - No-Touch development was shaky.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;98&lt;/span&gt;. Lower Cost for Massively Parallel Systems - How much does it cost to deploy a .NET application on a platform with 10,000 servers like google?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;99&lt;/span&gt;. More Profilers - Profilers mitigate the risk of not finding the root cause of show stopping bugs.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;100&lt;/span&gt;. Eclipse&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;101&lt;/span&gt;. OneHunderedReasons &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-2388277912030081296?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/2388277912030081296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=2388277912030081296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2388277912030081296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2388277912030081296'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2008/12/101-reasons-why-java-is-better-than-net.html' title='101 Reasons Why Java is Better than .NET'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-225338536039407011</id><published>2008-11-25T06:24:00.000-08:00</published><updated>2008-11-25T06:25:44.206-08:00</updated><title type='text'>Top 10 PHP MVC frameworks</title><content type='html'>&lt;h2 class="post-title"&gt;&lt;a href="http://www.mustap.com/phpzone_post_73_top-10-php-mvc-frameworks" title="Read entry: Top 10 PHP MVC frameworks"&gt;Top 10 PHP MVC frameworks&lt;/a&gt;&lt;/h2&gt;Development of PHP scripts without a preconceived plan to manage them is asking for a headache. The goal of a framework is to make the process of writing web-based applications simpler.&lt;br /&gt;&lt;br /&gt;An application designed around MVC is easier to manage because it is split into tiers, which allow for independent development. This promotes code reusability by building models, which are reusable throughout the application.&lt;br /&gt;&lt;br /&gt;What makes a good framework?&lt;br /&gt;&lt;br /&gt;&lt;a name="more"&gt;&lt;/a&gt;A good framework is easy to learn, simple to use, intuitive to work with, easy to extend or to modify, rapid to build (maintain) applications with and of course stable.&lt;br /&gt;&lt;br /&gt;Having said that, here is my top 10 PHP MVC Frameworks:&lt;br /&gt;&lt;br /&gt;10- &lt;a href="http://amb.sourceforge.net/"&gt;Ambivalence&lt;/a&gt;: A Java-Maverick Port&lt;br /&gt; 9- &lt;a href="http://www.phpwact.org/php/znf"&gt;WACT&lt;/a&gt;:  Web Application Component Toolkit&lt;br /&gt; 8- &lt;a href="http://www.achievo.org/atk"&gt;Achievo&lt;/a&gt;: A good RAD framework&lt;br /&gt; 7- &lt;a href="http://www.phpwact.org/php/phrame"&gt;Phrame&lt;/a&gt;: A Java-Struts port&lt;br /&gt; 6- &lt;a href="http://www.mojavelinux.com/projects/studs/"&gt;Studs&lt;/a&gt;: A Java-Struts port to PHP&lt;br /&gt; 5- &lt;a href="http://www.xisc.com/"&gt;Prado&lt;/a&gt;: The winner of Zend coding contest&lt;br /&gt; 4- &lt;a href="http://phpontrax.com/"&gt;PHPOnTrax&lt;/a&gt;: a Rails port - PHP5 Only&lt;br /&gt; 3- &lt;a href="http://www.cakephp.org/"&gt;CakePHP&lt;/a&gt;: Inspired by Rails PHP4/5&lt;br /&gt; 2- &lt;a href="http://www.phpwact.org/php/mojavi"&gt;Mojavi&lt;/a&gt;: The first MVC framework I fell in love with&lt;br /&gt;&lt;br /&gt;and the winner is:&lt;br /&gt;&lt;br /&gt; 1- &lt;a href="http://www.symfony-project.com/"&gt;Symfony&lt;/a&gt;: Based on Mojavi and inspired by Rails&lt;br /&gt;&lt;br /&gt;This list is based on my personal tests and use. I have tested and played with many others, but I think these are the best frameworks out there.&lt;br /&gt;- The first framework I fell in love with was Mojavi because of its elegant way to implement the MVC model.&lt;br /&gt;- Symfony corrected some problems in Mojavi and improved it by taking the good sides of RubyOnRails and Propel.&lt;br /&gt;- CakePHP is very promising, the only problem - really, I don't know if it is a problem - is: the development process is very slow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-225338536039407011?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/225338536039407011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=225338536039407011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/225338536039407011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/225338536039407011'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2008/11/top-10-php-mvc-frameworks.html' title='Top 10 PHP MVC frameworks'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-5706829756694732667</id><published>2008-11-23T22:08:00.000-08:00</published><updated>2008-11-23T22:18:41.635-08:00</updated><title type='text'>PHP Security Rules</title><content type='html'>&lt;h2 style="text-align: center; color: rgb(255, 102, 0);"&gt;&lt;a href="http://www.techinterviews.in/top-6-php-security-rules/7" rel="bookmark" title="Permanent Link: Top 6 PHP security rules"&gt;PHP security rules&lt;/a&gt;&lt;/h2&gt; here’re some PHP security tips:&lt;br /&gt;&lt;p&gt;(1) &lt;strong&gt;HTTPS&lt;/strong&gt;. No discussion, don’t assume anything if you haven’t got it.&lt;/p&gt; &lt;p&gt;(2) Userdata &lt;strong&gt;belongs on the server&lt;/strong&gt;, and stays on the server. Users know their own password, emailadres, etc, and why transfer logged in status &amp;amp; rights to and from the user? THe only place where they’re needed is on the server itself…&lt;/p&gt; &lt;p&gt;(3)  Using Cookies to keep track of logged in visitors &lt;strong&gt;is handy&lt;/strong&gt;. They should have random, unguessable values, and absolutely nothing to with their actual information. Their just an random ID for you, the data that they represent you can link on the server.&lt;/p&gt; &lt;p&gt;(4) &lt;strong&gt;Do not&lt;/strong&gt; keep users logged in. Session time out and cookies, if still present, become useless for anyone trying to use it later. Explain that to people who don’t want to remember passwords.&lt;/p&gt; &lt;p&gt;(5) &lt;strong&gt;Do not&lt;/strong&gt; use the same ID purposefully twice (although it might occur, chances should be very slim). A user logs in, and gets a random id.&lt;/p&gt; &lt;p&gt;(6) &lt;strong&gt;THE golden rule&lt;/strong&gt;: never, ever trust user input. If you expect a number, make sure it’s a number. If you expect only certain characters, make sure there are no other. If you cannot escape the fact that users have to enter an unknown text, use the escaping tools of characters at your disposal. Be very, very weary for SQL injection.&lt;/p&gt; There are others, but these are the most important imho. There are others, like keep a log what users do from what location, but that’s usually only needed when is has gone wrong, and you have to track it back, never save a plain password, do not display errors in you code should it break for some reason, error-displaying is for development, etc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-5706829756694732667?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/5706829756694732667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=5706829756694732667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5706829756694732667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/5706829756694732667'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2008/11/interview.html' title='PHP Security Rules'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8328462747836488182.post-2977703846094844848</id><published>2008-11-20T22:15:00.000-08:00</published><updated>2008-11-20T22:21:55.024-08:00</updated><title type='text'>10 Advanced PHP Tips To Improve Your Programming</title><content type='html'>&lt;p&gt;PHP programming has climbed rapidly since its &lt;a href="http://en.wikipedia.org/wiki/PHP"&gt;humble beginnings&lt;/a&gt; in 1995. Since then, PHP has become the most popular programming language for Web applications. Many popular websites are powered by PHP, and an overwhelming majority of scripts and Web projects are built with the popular language.&lt;/p&gt; &lt;p&gt;Because of PHP’s huge popularity, &lt;strong&gt;it has become almost impossible for Web developers not to have at least a working knowledge of PHP&lt;/strong&gt;. This tutorial is aimed at people who are just past the beginning stages of learning PHP and are ready to roll up their sleeves and get their hands dirty with the language. Listed below are 10 excellent techniques that PHP developers should learn and use every time they program. These tips will speed up proficiency and make the code much more responsive, cleaner and more optimized for performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3&gt;1. Use an SQL Injection Cheat Sheet&lt;/h3&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://88.198.60.17/images/10-advanced-php-techniques/sql.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 377px; height: 161px;" src="http://88.198.60.17/images/10-advanced-php-techniques/sql.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;em&gt;A list of common SQL injections.&lt;/em&gt; &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/SQL_injection"&gt;SQL injection&lt;/a&gt; is a nasty thing. An SQL injection is a security exploit that allows a hacker to dive into your database using a vulnerability in your code. While this article isn’t about MySQL, many PHP programs use MySQL databases with PHP, so knowing what to avoid is handy if you want to write secure code.&lt;/p&gt; &lt;p&gt;Furruh Mavituna has a very nifty &lt;a href="http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/#AboutMySQLandPHP"&gt;SQL injection cheat sheet&lt;/a&gt; that has a section on vulnerabilities with PHP and MySQL. If you can avoid the practices the cheat sheet identifies, your code will be much less prone to scripting attacks.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;2. Know the Difference Between Comparison Operators&lt;/h3&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://78.46.108.98/images/10-advanced-php-techniques/php.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 500px; height: 406px;" src="http://78.46.108.98/images/10-advanced-php-techniques/php.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;PHP’s list of comparison operators.&lt;/em&gt; &lt;p&gt;&lt;a href="http://docs.php.net/manual/en/language.operators.comparison.php"&gt;Comparison operators&lt;/a&gt; are a huge part of PHP, and some programmers may not be as well-versed in their differences as they ought. In fact, &lt;a href="http://ioreader.com/2007/08/17/11-cool-things-about-php-that-most-people-overlook/"&gt;an article at I/O reader&lt;/a&gt; states that many PHP developers can’t tell the differences right away between comparison operators. Tsk tsk.&lt;/p&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family: courier new;"&gt;These are extremely useful and most PHPers can’t tell the difference between == and ===. Essentially, == looks for equality, and by that PHP will generally try to coerce data into similar formats, eg: 1 == ‘1′ (true), whereas === looks for identity: 1 === ‘1′ (false). The usefulness of these operators should be immediately recognized for common functions such as strpos(). Since zero in PHP is analogous to FALSE it means that without this operator there would be no way to tell from the result of strpos() if something is at the beginning of a string or if strpos() failed to find anything. Obviously this has many applications elsewhere where returning zero is not equivalent to FALSE.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Just to be clear, == looks for equality, and === looks for identity. You can see a &lt;a href="http://docs.php.net/manual/en/language.operators.comparison.php"&gt;list of the comparison operators&lt;/a&gt; on the PHP.net website.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;3. Shortcut the else&lt;/h3&gt; &lt;p&gt;&lt;em&gt;It should be noted that tips 3 and 4 both might make the code slightly less readable. The emphasis for these tips is on speed and performance. If you’d rather not sacrifice readability, then you might want to skip them.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Anything that can be done to make the code simpler and smaller is usually a good practice. One such tip is to take the middleman out of &lt;a href="http://us3.php.net/else"&gt;else statements&lt;/a&gt;, so to speak. Christian Montoya has an &lt;a href="http://www.christianmontoya.com/2007/11/09/php-techniques-i-use-all-the-time/"&gt;excellent example&lt;/a&gt; of conserving characters with shorter else statements.&lt;/p&gt; &lt;p&gt;Usual else statement:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt;( this condition )  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;{  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="vars"&gt;$x&lt;/span&gt;&lt;span&gt; = 5;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;else&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;{  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="vars"&gt;$x&lt;/span&gt;&lt;span&gt; = 10;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;if( this condition ) { $x = 5; } else { $x = 10; } &lt;/pre&gt; &lt;p&gt;If the $x is going to be 10 by default, just start with 10. No need to bother typing the else at all.&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="vars"&gt;$x&lt;/span&gt;&lt;span&gt; = 10;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt;( this condition )  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;{  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="vars"&gt;$x&lt;/span&gt;&lt;span&gt; = 5;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;$x = 10; if( this condition ) { $x = 5; } &lt;/pre&gt; &lt;p&gt;While it may not seem like a huge difference in the space saved in the code, if there are a lot of else statements in your programming, it will definitely add up.&lt;/p&gt; &lt;h3&gt;4. Drop those Brackets&lt;/h3&gt; &lt;p&gt;&lt;a href="http://evolt.org/these-things-i-know-php-tips"&gt;&lt;img src="http://88.198.60.17/images/10-advanced-php-techniques/things.gif" alt="Drop Brackets" width="329" height="304" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;Dropping brackets saves space and time in your code.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Much like using shortcuts when writing else functions, you can also save some characters in the code by dropping the brackets in a single expression following a control structure. Evolt.org has a &lt;a href="http://evolt.org/these-things-i-know-php-tips"&gt;handy example&lt;/a&gt; showcasing a bracket-less structure.&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="vars"&gt;$gollum&lt;/span&gt;&lt;span&gt; == &lt;/span&gt;&lt;span class="string"&gt;'halfling'&lt;/span&gt;&lt;span&gt;) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="vars"&gt;$height&lt;/span&gt;&lt;span&gt; --;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;if ($gollum == 'halfling') { $height --; } &lt;/pre&gt; &lt;p&gt;This is the same as:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="vars"&gt;$gollum&lt;/span&gt;&lt;span&gt; == &lt;/span&gt;&lt;span class="string"&gt;'halfling'&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span class="vars"&gt;$height&lt;/span&gt;&lt;span&gt; --;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;if ($gollum == 'halfling') $height --; &lt;/pre&gt; &lt;p&gt;You can even use multiple instances:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="vars"&gt;$gollum&lt;/span&gt;&lt;span&gt; == &lt;/span&gt;&lt;span class="string"&gt;'halfling'&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span class="vars"&gt;$height&lt;/span&gt;&lt;span&gt; --;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="keyword"&gt;else&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="vars"&gt;$height&lt;/span&gt;&lt;span&gt; ++;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="vars"&gt;$frodo&lt;/span&gt;&lt;span&gt; != &lt;/span&gt;&lt;span class="string"&gt;'dead'&lt;/span&gt;&lt;span&gt;)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="func"&gt;echo&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="string"&gt;'Gosh darnit, roll again Sauron'&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;foreach&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="vars"&gt;$kill&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;as&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="vars"&gt;$count&lt;/span&gt;&lt;span&gt;)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="func"&gt;echo&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="string"&gt;'Legolas strikes again, that makes'&lt;/span&gt;&lt;span&gt; . &lt;/span&gt;&lt;span class="vars"&gt;$count&lt;/span&gt;&lt;span&gt; . &lt;/span&gt;&lt;span class="string"&gt;'for me!'&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;if ($gollum == 'halfling') $height --; else $height ++;   if ($frodo != 'dead') echo 'Gosh darnit, roll again Sauron';  foreach ($kill as $count) echo 'Legolas strikes again, that makes' . $count . 'for me!'; &lt;/pre&gt; &lt;h3&gt;5. Favour str_replace() over ereg_replace() and preg_replace()&lt;/h3&gt; &lt;p&gt;&lt;a href="http://bitfilm.net/2007/08/24/tips-for-faster-php-scripts/"&gt;&lt;img src="http://78.46.108.98/images/10-advanced-php-techniques/replace.gif" alt="Str Replace" width="379" height="238" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;Speed tests show that str_replace() is 61% faster.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;In terms of efficiency, &lt;a href="http://us.php.net/manual/en/function.str-replace.php"&gt;str_replace()&lt;/a&gt; is much more efficient than &lt;a href="http://us2.php.net/manual/en/regexp.reference.php"&gt;regular expressions&lt;/a&gt; at replacing strings. In fact, according to &lt;a href="http://bitfilm.net/2007/08/24/tips-for-faster-php-scripts/"&gt;Making the Web&lt;/a&gt;, str_replace() is 61% more efficient than regular expressions like &lt;a href="http://us.php.net/manual/en/function.ereg-replace.php"&gt;ereg_replace()&lt;/a&gt; and &lt;a href="http://us.php.net/manual/en/function.preg-replace.php"&gt;preg_replace()&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you’re using regular expressions, then ereg_replace() and preg_replace() will be much faster than str_replace().&lt;/p&gt; &lt;h3&gt;6. Use Ternary Operators&lt;/h3&gt; &lt;p&gt;Instead of using an if/else statement altogether, consider using a &lt;a href="http://www.phpvalue.com/what-is-php-ternary-opeartor/"&gt;ternary operator&lt;/a&gt;. PHP Value gives an excellent example of what a ternary operator looks like.&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="comment"&gt;//PHP COde Example usage for: Ternary Operator&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="vars"&gt;$todo&lt;/span&gt;&lt;span&gt; = (&lt;/span&gt;&lt;span class="func"&gt;empty&lt;/span&gt;&lt;span class="keyword"&gt;empty&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class="vars"&gt;$_POST&lt;/span&gt;&lt;span&gt;[’todo’])) ? ‘&lt;/span&gt;&lt;span class="keyword"&gt;default&lt;/span&gt;&lt;span&gt;’ : &lt;/span&gt;&lt;span class="vars"&gt;$_POST&lt;/span&gt;&lt;span&gt;[’todo’];   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="comment"&gt;// The above is identical to this if/else statement&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span class="func"&gt;empty&lt;/span&gt;&lt;span class="keyword"&gt;empty&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class="vars"&gt;$_POST&lt;/span&gt;&lt;span&gt;[’todo’])) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="vars"&gt;$action&lt;/span&gt;&lt;span&gt; = ‘&lt;/span&gt;&lt;span class="keyword"&gt;default&lt;/span&gt;&lt;span&gt;’;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;} &lt;span class="keyword"&gt;else&lt;/span&gt;&lt;span&gt; {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="vars"&gt;$action&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class="vars"&gt;$_POST&lt;/span&gt;&lt;span&gt;[’todo’];  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;?&gt;  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;//PHP COde Example usage for: Ternary Operator $todo = (empty($_POST[’todo’])) ? ‘default’ : $_POST[’todo’];   // The above is identical to this if/else statement if (empty($_POST[’todo’])) { $action = ‘default’; } else { $action = $_POST[’todo’]; } ?&gt; &lt;/pre&gt; &lt;p&gt;&lt;strong&gt;The ternary operator frees up line space and makes your code less cluttered, making it easier to scan&lt;/strong&gt;. Take care not to use more than one ternary operator in a single statement, as PHP doesn’t always know what to do in those situations.&lt;/p&gt; &lt;h3&gt;7. Memcached&lt;/h3&gt; &lt;p&gt;&lt;a href="http://www.danga.com/memcached/"&gt;&lt;img src="http://88.198.60.17/images/10-advanced-php-techniques/memcached.gif" alt="Memcached" width="485" height="366" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;Memcached is an excellent database caching system to use with PHP.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;While there are tons of caching options out there, &lt;a href="http://www.danga.com/memcached/"&gt;Memcached&lt;/a&gt; keeps topping the list as &lt;strong&gt;the most efficient for database caching&lt;/strong&gt;. It’s not the easiest caching system to implement, but if you’re going to build a website in PHP that uses a database, Memcached can certainly speed it up. The caching structure for Memcached was first built for the PHP-based blogging website LiveJournal.&lt;/p&gt; &lt;p&gt;PHP.net has an excellent tutorial on &lt;a href="http://us3.php.net/memcache"&gt;installing and using memcached&lt;/a&gt; with your PHP projects.&lt;/p&gt; &lt;h3&gt;8. Use a Framework&lt;/h3&gt; &lt;p&gt;&lt;a href="http://www.cakephp.org/"&gt;&lt;img src="http://78.46.108.98/images/10-advanced-php-techniques/cakephp.png" alt="Framework" width="459" height="249" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;CakePHP is one of the top PHP frameworks.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;You may not be able to use a PHP framework for every project you create, but frameworks like &lt;a href="http://www.cakephp.org/"&gt;CakePHP&lt;/a&gt;, &lt;a href="http://framework.zend.com/"&gt;Zend&lt;/a&gt;, &lt;a href="http://www.symfony-project.org/"&gt;Symfony&lt;/a&gt; and &lt;a href="http://codeigniter.com/"&gt;CodeIgniter&lt;/a&gt; can &lt;strong&gt;greatly decrease the time spent developing a website&lt;/strong&gt;. A Web framework is software that bundles with commonly needed functionality that can help speed up development. Frameworks help eliminate some of the overhead in developing Web applications and Web services.&lt;/p&gt; &lt;p&gt;If you can use a framework to take care of the repetitive tasks in programming a website, you’ll develop at a much faster rate. &lt;strong&gt;The less you have to code, the less you’ll have to debug and test&lt;/strong&gt;.&lt;/p&gt; &lt;h3&gt;9. Use the Suppression Operator Correctly&lt;/h3&gt; &lt;p&gt;The error suppression operator (or, in the PHP manual, the “&lt;a href="http://us2.php.net/operators.errorcontrol"&gt;error control operator&lt;/a&gt;“) is the @ symbol. When placed in front of an expression in PHP, it simply tells any errors that were generated from that expression to now show up. This variable is quite handy if you’re not sure of a value and don’t want the script to throw out errors when run.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;However, programmers often use the error suppression operator incorrectly.&lt;/strong&gt; The @ operator is rather slow and can be costly if you need to write code with performance in mind.&lt;/p&gt; &lt;p&gt;Michel Fortin has some &lt;a href="http://michelf.com/weblog/2005/bad-uses-of-the-at-operator/"&gt;excellent examples&lt;/a&gt; on how to sidestep the @ operator with alternative methods. Here’s an example of how he used isset to replace the error suppression operator:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt; (isset(&lt;/span&gt;&lt;span class="vars"&gt;$albus&lt;/span&gt;&lt;span&gt;))  &lt;/span&gt;&lt;span class="vars"&gt;$albert&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span class="vars"&gt;$albus&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;&lt;span class="keyword"&gt;else&lt;/span&gt;&lt;span&gt;                &lt;/span&gt;&lt;span class="vars"&gt;$albert&lt;/span&gt;&lt;span&gt; = NULL;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;if (isset($albus))  $albert = $albus; else                $albert = NULL; &lt;/pre&gt; &lt;p&gt;is equivalent to:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="vars"&gt;$albert&lt;/span&gt;&lt;span&gt; = @&lt;/span&gt;&lt;span class="vars"&gt;$albus&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;$albert = @$albus; &lt;/pre&gt; &lt;p&gt;But while this second form is good syntax, it runs about two times slower. A better solution is to assign the variable by reference, which will not trigger any notice, like this:&lt;/p&gt; &lt;div class="dp-highlighter"&gt;&lt;div class="bar"&gt;&lt;div class="tools"&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;"&gt;view plain&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;"&gt;copy to clipboard&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;"&gt;print&lt;/a&gt;&lt;a href="http://www.smashingmagazine.com/2008/11/18/10-advanced-php-tips-to-improve-your-progamming/#" onclick="dp.sh.Toolbar.Command('About',this);return false;"&gt;?&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class="dp-c" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="vars"&gt;$albert&lt;/span&gt;&lt;span&gt; =&amp;amp; &lt;/span&gt;&lt;span class="vars"&gt;$albus&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;pre style="display: none;" name="code" class="php"&gt;$albert =&amp;amp; $albus; &lt;/pre&gt;  &lt;p&gt;It’s important to note that these changes can have some accidental side effects and should be used only in performance-critical areas and places that aren’t going to be affected.&lt;/p&gt; &lt;h3&gt;10. Use isset instead of strlen&lt;/h3&gt; &lt;p&gt;&lt;a href="http://blog.dynom.nl/archives/String-length-vs-isset-to-check-string-lengths_20070807_5.html"&gt;&lt;img src="http://88.198.60.17/images/10-advanced-php-techniques/isset.gif" alt="Strlen" width="404" height="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;Switching isset for strlen makes calls about five times faster.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;If you’re going to be checking the length of a string, use isset instead of strlen. &lt;strong&gt;By using isset, your calls will be about five times quicker&lt;/strong&gt;. It should also be noted that by using isset, your call will still be valid if the variable doesn’t exist. The D-talk has an example of how to &lt;a href="http://blog.dynom.nl/archives/String-length-vs-isset-to-check-string-lengths_20070807_5.html"&gt;swap out isset for strlen&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;A while ago I had a discussion about the optimal way to determine a string length in PHP. The obvious way is to use strlen().&lt;/p&gt; &lt;p&gt;However to check the length of a minimal requirement it’s actually not that optimal to use strlen. The following is actually much faster (roughly 5 times)&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;It’s a small change but, like all the tips we’ve covered today, adds up to quicker, leaner code.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8328462747836488182-2977703846094844848?l=divyesh-karelia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divyesh-karelia.blogspot.com/feeds/2977703846094844848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8328462747836488182&amp;postID=2977703846094844848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2977703846094844848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8328462747836488182/posts/default/2977703846094844848'/><link rel='alternate' type='text/html' href='http://divyesh-karelia.blogspot.com/2008/11/10-advanced-php-tips-to-improve-your.html' title='10 Advanced PHP Tips To Improve Your Programming'/><author><name>Divyのsh Karelia</name><uri>http://www.blogger.com/profile/10681868948955210961</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='26' src='http://2.bp.blogspot.com/_BiThJX7sxNw/SSarUkOvHYI/AAAAAAAAAAc/cSZq5GW8Gbc/S220/DSC01756.JPG'/></author><thr:total>0</thr:total></entry></feed>
