Magento – save and get data from cache
Just a method to save and get data from magento cache $mydataforcache = “My data for cache”; $cache_name = “maycachename”; $CACHEDATA = MAGE::app()->loadCache($cache_name); if (isset($CACHEDATA)…
Just a method to save and get data from magento cache $mydataforcache = “My data for cache”; $cache_name = “maycachename”; $CACHEDATA = MAGE::app()->loadCache($cache_name); if (isset($CACHEDATA)…
Compare two dates in Javascript: <html> <head> <title>JavaScript – compare two dates</title> </head> <body> <script language=”Javascript” type=”text/javascript”> var date1 = new Date(“22/12/2010”); var date2 =…
Specify the DocType $this->doctype(‘XHTML1_STRICT’); XHTML1_STRICT – XHTML 1.0 Strict XHTML1_TRANSITIONAL – XHTML 1.0 Transitional HTML4_STRICT – HTML 4.01 Strict HTML4_Loose – HTML 4.01 Loose HTML5…
Script to import newsletter subscribers
Javascript get elemens by name: <html> <head> <script type=”text/javascript”> function getInputValues(varName) { varValues = document.getElementsByName(varName); for (var i = 0; i < varValues.length; i++) {…
Javascript redirect to another page window.location = “redirect url”;
Javascript code to be used when you need a confirmation before leaving a page: <script language=”javascript” type=”text/javascript”> window.onbeforeunload = confirmClose; function confirmClose(){ return “Are you…
MySQL command to view all tables from a database: SHOW TABLES;
MySQL command to view databases from server: SHOW DATABASES;
MySQL command to view user privileges: SHOW GRANTS FOR ‘root’@’localhost’;