php very useful mysql connect function for small project

Posted on Leave a commentPosted in MYSQL, PHP

This class is very useful for small projects, it easy and fast to connect mysql with php script. Thank you Ciprian Mocanu to provide this document. The Class:

Example usage:

How to extend Magento core controller?

Posted on Leave a commentPosted in PHP

Hi, today I’ll show you how to edit Magento’s core module without messing with core files themselves, or “the right way of doing things”. 😀 First of all, I chose Magento’s Customer module and its Account controller as an example. First, you need to find it in Magento’s Core folder (full path: “app/code/core/Mage/Customer/controllers/AccountController.php“). First step […]

Good example to security ajax call

Posted on Leave a commentPosted in AJAX, JAVASCRIPT, PHP

Step-1 : Generate Token System For All Web-Service: Generating Token :

Step-2 : Use it while sending ajax call:

Step-3 : NOW, Let’s secure ajax handler PHP file with,

Magento add a new product from costom module

Posted on 1 CommentPosted in PHP

Hers is sample code:

Magento: Difference between Mage::getSingleton() and Mage::getModel() in Magento

Posted on Leave a commentPosted in PHP

Some people ask about the difference between Mage::getModel() and Mage::getSingleton() in Magento. Here is the difference between these two: Mage::getModel(‘module/model’) will create a new instance of the model object (if such object exists in configuration) So if we write: Mage::getModel(‘catalog/product’), it will create new instance of the object product each time. So, $p1 = Mage::getModel(‘catalog/product’); […]

Magento form validation front/end

Posted on 1 CommentPosted in JAVASCRIPT, LINUX, PHP

Here is an example:

another one

For the backend, we can use zend validator