MEET - Phir se ruth jaao…

August 2nd, 2010

“Phir se ruth jaao, koi manayega….

Dil se dil ka taar jod jayega…..

Kabhi lage ki `MEET` door hai aagar…..

Aap chaah ke to dekho, kahin bhi ho laut aayega.”   :)

- MEET (2nd Aug 2010)

Author: gaurav Categories: Others Tags:

Get IP And Location using PHP

April 22nd, 2010

<?php

$ip=$_SERVER['REMOTE_ADDR'];

echo “<font face=’Verdana’ size=’3′><b>IP Address= $ip</b>”;

$url = “http://www.ipmango.com/api.php?ip=”.$ip; $xml = simplexml_load_file($url);

echo “City : {$xml->city} <br />”;

echo “Region : {$xml->region} <br />”;

echo “Country Name : {$xml->countryname} <br />”;

echo “Latitude : {$xml->latitude} <br />”;

echo “Longitude : {$xml->longitude} <br />”;

?>

Refer: http://www.shefeekj.com/get-ip-and-location-using-php.html

Author: garima Categories: PHP Tags:

Steps for Drupal Multi-language website

April 13th, 2010
Steps for Drupal Multi-language website:

*  Login as administrator.

*  Go to Administer > Site Building > Modules (/admin/build/modules)

* Enable Locale & Content Translation modules (under Core Optional Group)

*  Go to Administer > Site Configuration > Languages (admin/settings/language)

* Click on add language tab

* From the drop down of languages, select Marathi & click on Add language button

* On the Languages list page, you will now see mr (Marathi) as a language, enable it & make it default

*  Download drupal translater and install it. (for installation, you need to upload translations directories of openid, system modules and profile related file in drupal default profile directory).

* Go to Administer > Site Building >Translate Interface (admin/build/translate)

* Click on Search Tab (admin/build/translate/search)

* Enter the string / text you wish to translate to Marathi (e.g. Log in)

* If the string is found, a list of all the places where this string is used in Drupal site is displayed.

* In that list, go to the row which you want to translate to another language, click on edit  and add that translation of the string.


Author: garima Categories: Drupal Tags:

Drupal: How to use separate template in separate page

April 13th, 2010

Drupal: Good article for Using Multiple Templates -

Author: garima Categories: Drupal Tags:

Difference Between PHP4 & PHP 5

April 12th, 2010

Difference Between PHP4 & PHP 5

1. Soap, MySQLi and Sqlite extension introduced in php5

2. Exception handling has been introduced in PHP5 (i.e. try and catch statements)

3. Objects can iterate through foreach in PHP5

$object = new IteratorTest();

foreach ($object as $value) {

print $value;

}

4. Added public/private/protected access modifiers in PHP5

5. Introduced Unified constructor name __construct() in PHP5

6. Object destructor support by defining a __destructor() method in PHP5

7. Introduced abstract classes & methods

Good article to go through:

http://devzone.zend.com/article/1714

Author: garima Categories: PHP Tags:

Difference between MyISAM and InnoDB

April 12th, 2010

Difference between MyISAM and InnoDB

1. Transactions: InnoDB support transactions means You can commit and rollback with InnoDB but with MyISAM once you issue a command it’s done. But MYISAM does not support any database transactions means if the transactions related to large amount of data transfer it will not provide because memory is less.

2. Locking: INNODB provide the row level locking means if you are performing an insert into InnoDB table only that row will be locked not the entire table. While MYISAM provide the table level locking means if the data in one row has been modified, the entire table will lock for the next process.

3. Foreign keys – InnoDB support FK constraint but MYISAM tables do not support.

4. Data Types: MYISAM provide a full variety of datatypes, but INNODB will not.

5. Full Text Search: InnoDB does not support Full Text search but MyIsam provide full text search.

6. Memory Space: MYISAM occupies less memory sapce for tables rather than InnoDB tables.

Author: gaurav Categories: MySQL Tags:

Google’s website translator

February 17th, 2010
You can add Google’s website translator to your webpages, and offer instant access to automatic translation of the pages. Adding the website translator is quick and easy.

Here’s how to do it:

Author: garima Categories: Google Tags:

How to check execution time of a page

June 7th, 2009

Code:

// Add this in top of the script

$page_start_time = microtime(true);

 

// Add this in top of the script

if($page_start_time != 0){

       $page_end_time = microtime(true);

$differ = number_format($page_end_time - $page_start_time , 4);

echo “Page Load Time:  ”.$differ.” Seconds”;

}

Author: gaurav Categories: PHP Tags:

MYSQL Query to export data order by given values in comma separated string:

June 7th, 2009

MYSQL Query to export data order by given values in comma separated string.  If you want to get the record in an specific order you can do it like this:

SELECT * FROM {TABLE_NAME} WHERE {FIELD_NAME} IN ( 23, 234, 543, 23 ) ORDER BY FIELD({FIELD_NAME}, 23, 234, 543, 23 )

Example:  SELECT * FROM `product_master` WHERE paSKU IN (’1a6′,’1a1′,’1a8′,’1a3′,’1a4′) ORDER BY FIELD (paSKU,’1a6′,’1a1′,’1a8′,’1a3′,’1a4′)

Author: gaurav Categories: MySQL Tags:

Basic Linux Commands

May 6th, 2009

Install json
1. Install json - This was actually trickier than expected. I assumed I would be able to install this via pear. Apparently, a PEAR Services_JSON package was developed, but it has never been accepted into the official repository. The trick instead is to use the PECL json package. This was as easy as running pecl install json and watching the compiler do its thing. When it’s done you should have a json.so file in your PHP modules directory. (Mine is /usr/lib/php/modules/.)
2. Add json.ini file to /etc/php.d/ - This file is pretty simple. Simply add extension=json.so to this file and that will enable the extension.
3. Restart Apache - Not much more to add here. Without the restart, the extension won’t be loaded.

Curl with post variables
curl -v \ –data ‘form=1&form_refresh=1&name=admin&password=onsumaye{}123&enter=Enter’ \ ‘http://domain.com

Change Hostname
hostname utils.domain.com
vi /etc/sysconfig/network

Author: garima Categories: Linux Tags:
Site is Under Construction