Tuesday, November 10, 2009

long number problem in php 5.2.6

I found an interesting problem with long numbers using php 5.2.6. Yah, the current version of php is 5.3 but some hosting server still using older versions.

my problem was the following:


$integer = 2304200000;
echo $integer; //outputs 2.3042E+09

$float = (float)100000; //float
echo $float; //outputs 1E+05


this gives many weird results in calculation. I have faced this problem and this bug has eaten up a lot of time.So, I am others time regarding the big number problem in php 5.2.6.

If you use number_format or sprintf then you will get the number as aspected.


$integer = 2304200000;
$int = number_format($integer, 0, '.', '');
echo $int; //outputs 2304200000 as expected

$float = (float)100000 //float;
$float = number_format($float, 2, '.', '');
echo $float; //outputs 100000.00 as expected




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, October 14, 2009

increasing file upload size in wordpress.

I have faced a problem regarding uploading of big images in wordress. In php 5.2.5, it has change it's configuration file structure. Now it sets access level to it's directives. The levels are 7,4,2,1. And for this access control now we can't modify every configuration settings by ini_set() function in runtime.

Those that have access level 7, can be modified by ini_set() function. And some can be set using .htaccess file. And some need to have admin level access.

If you want to use .htaccess file then you need to paste the following code into you .htaccess file.


php_value upload_max_filesize 100M
php_value post_max_size 105M
php_value max_execuetion_time 300
php_value memory_limit 64M


you need to set post_max_size to larger size than upload_max_filesize, as there could be multiple upload field in a form.

Now, while you are using .htaccess file, the server may not support the directive changing command that you are trying to modify. I mean your server need to have AllowOverride property On for the specific directive that you are trying to modify. you need to contact with your hosting server support.

There is another way, you can create a php.ini file with the configuration directive that you want to change. For image uploading in wordpress, you can create the following php.ini file.


;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

upload_max_filesize = 100M;
post_max_size = 105M;
max_execution_time = 300;

;End:


you need to place it under the wp-admin folder.






List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, September 29, 2009

Api for XML

There are various api for accessing xml documents. They are the following-

  • Stream oriented api: Simple api for xml or SAX, it is event based.
  • Tree traversal api: Dom is a tree-traversal api. DOM implementation is memory intensive, as it loads the whole xml tree before accessing data.
  • Xml data binding: which is a automated way to convert XML document.
  • Declarative transformation languages: XSLT, XQuery.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Monday, September 28, 2009

Introduction to JSON

JSON means javascript object notation. JSON is lightweight and very easy to parse.
It is not a markup language. The basis of JSON is that javascript’s object literal
is the ideal way for transmitting object oriented data across the network. Json made it easier to produce distributed object and applications. JSON does not support octal or hex characters. The character encoding of json is always Unicode. Json is the preferred way for ajax applications. A response text can be converted to javascript with eval() function. json's values can be used directly, no convertiion needed. this is the most significant reason to use json. json has no namespaces so there is no nesting and it uses context. JSON doesn't have any validator.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, September 27, 2009

Why should I use static variable?

Let’s see the difference between static and non-static variable:
Static is used for those method and variables which are accessed from other classes or functions also. If we use non-static, then we need to instantiate the class each time to use that methods or variables. Static variable has it’s scope until the script ends, whereas a non-static variable lost it’s value when it’s scope ends.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, September 23, 2009

OOP vs procedural

OOP provides ways for extensible application. this approach removes the drawbacks of procedural paradigm. it gives first priority to data. it packs data and functions, which have access to this functions. this avoids unauthorized access to functions. So, OOP gives us ability of reuse, inheritence, access modifier.

procedural provides ways for fast, shortcut approach for programming. so, before coding we must think what we want to do. if we want a small coding to do a small job, then we must go for procedural approach. But as the requirements grew, it was seen that the programs were getting larger and larger and it became difficult to debug. So functions were introduced to reduce the size of the programs and improve readability in them. Still that was not enough. In this approach, data is getting corrupted, as many functions which are not allowed to access the function can access the functions. so, here more focus was given on functions, rather than data.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, September 20, 2009

Problem with normal and session variable having same name

If your register_globals is set to ON, then a normal variable will overwrite a session variable with the same name. In webid, I faced this problem. It's not a good practice to turn ON register_globals. So, turn it Off it will fix the problem with same variable name.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, September 17, 2009

xml vs database

XML can be used as databases. But the question is that why should I use it or why should I avoid it? XML has the properties of storage, portability, schemas. Xml is self describing means the elements, attributes tells what the data it contains. It also describes data in tree or graph structure.
Xml provides many qualities of databases.
1. Storage: Xml documents.
2. Schemas: DTDs, Xml schemas.
3. Query languages: Xpath, Xquery.
4. Programming interfaces: SAX, DOM.
And it also lacks some of the cool features of databases.
1. Security.
2. Integrity.
3. Indexes.
4. Transaction.
5. Efficient storage.
6. Multi user access.
7. Triggers.
8. Queries across multiple documents.
So, xml can be used as a database for few users, small amount of data. But for product environment where there will larger data, huge user, need data integrity, there needs databases. So, there is very little advantage to use xml as a database.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, September 16, 2009

.htaccess intro

.htaccess files are used to modify server configuration on per-directory basis. It is used when a user doesn’t has access to modify server configuration settings. The directives in .htaccess file is applied for the current directory and subdirectories. .htaccess uses those directives that has their AllowOverride property set to not none.

If we can, we should avoid using .htaccess file mainly for the following 2 reasons –
1. When we set AllowOverride property to allow modification in .htaccess files, then the server checks every directory for .htaccess file. This hit the performance.
2. Second one is security. We are allowing users to change server configuration. So, it may become a security hole.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, September 15, 2009

Use component as multipart document

This will use different component of a webpage as an attachment. So, components will be loaded with one http request. This will improve webpage loading time. But iphone doesn’t support this technique.




List of my works:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide