When webpage was loaded, unique session id will generated and that stored in cookie. If cookie will removed then session cant retain.
November 10, 2014
What happen when Browser Cookie will Removed, Session retains as its ?
Labels:
Browser Cookie Removal,
Cookie,
php,
Session
When webpage was loaded, unique session id will generated and that stored in cookie. If cookie will removed then session cant retain.
PHP Session and Cookie
Labels:
Cookie,
php,
PHP Cookie,
PHP Session,
Session
The main difference between sessions and cookies is that cookies are stored in the user's browsers, and session are stored in server.
A cookie is small file that store in user's computer. Cookie data expiry depend on expiration date where session retain until browser run.
PHP List of array sort functions
Labels:
php,
PHP arrays,
Use of arrays
sort(). rsort(). natsort(). natcasesort(). ksort(). krsort(). asort(). arsort().
Use of array_map Function in Real Time ?
Labels:
array_map,
php,
php array_map
It will apply for many things. For example want to do php function for set of elements will use that
Example
If have like below
but instead of above
Example
If have like below
$first_name = trim($_POST['firstname']); $lastname = trim($_POST['lastname']);
but instead of above
$_POST = array_map("trim", $_POST);
$array = array_map("trim", $array);
It will remove the spaces for the set of elements.
How to Add the Element to the array First & Last, how to remove the same ?
Labels:
array_pop,
array_push,
array_shift,
array_unshift,
php
array_push - Adding elemen to the last
array_unshift - First element to prepend
array_pop - Remove the first element of the array
array_shift - Remove the last element
How to determine PHP version in Servers ?
Labels:
php,
php version,
phpinfo()
PHPINFO gives various detail scripting running system, Apache built-in modules, PHP working directory, PHP modules, PERL information and third party system information that are used in server.
phpinfo();
Type of Magento Sessions
Labels:
Magento,
Magento sessions,
type of magento sessions
Core/Session:
Handles information about end user ip address, messages, cookies
Handles information about the customer.
Checkout/Session:
Handles information about the checkout, cart and details of guest account user
Mage::getSingelton('core/session')
Handles information about end user ip address, messages, cookies
Customer/Session:
Mage::getSingleton('customer/session')
Handles information about the customer.
Checkout/Session:
Mage::getSingleton('checkout/session')
Handles information about the checkout, cart and details of guest account user
October 28, 2014
Magento Interview Questions
Labels:
Magento,
New Order Id,
php
Getting order id for new order
Magento get new order id based on "eav_entity_store" tablePHP Interview Questions
Echo vs print.
echo() and print() are language constructs in PHP, both are used to output strings.
echo() can take multiple expressions whereas print cannot take multiple expressions.
August 07, 2014
Magneto create admin user progrmatically
Labels:
create user,
ecommerce,
Magento
### Create New admin User programmatically. ####
require_once('./app/Mage.php');
umask(0);
Mage::app();
try {
$user = Mage::getModel('admin/user')
->setData(array(
'username' => '[user_name]',
'firstname' => 'Admin',
'lastname' => 'Admin',
'email' => '[user_email]',
'password' => 'admin123',
'is_active' => 1
))->save();
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
//Assign Role Id
try {
//Administrator role id is 1 ,Here you can assign other roles
$user->setRoleIds(array(1))
->setRoleUserId($user->getUserId())
->saveRelations();
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
echo 'Admin user created successfully';
Subscribe to:
Posts (Atom)