search
top

Ajax in Magento

There are some instances when we are required to use Ajax features in Magento. Prototype javascript library used in Magento has inbuilt functionality for Ajax. I am describing here the basic method to use ajax. I have used version 1.6.0.0 of Magento. I am using the existing Contacts module for explanation, you can make any new module or use any of your local module. This code will generate the hash...
read more

Page Redirect

I have written a script for getting the files list from directory and redirecting the page on selecting option from the select box. So you will get the script for fetching all the files from current directory and redirecting page on selection. <h>Please select option</h> <?php $path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; //current directory physical path $dir_handle...
read more

Assign PHP Array to Javascript Array

I am describing here a very useful method for getting the values of a PHP array in JavaScript. For this we need to assign the PHP array values to a array in JavaScript. <?php $a = array('A','B','C'); ?> <html> <head> <title>Assign PHP Array to Javascript Array</title> <script language="javascript"> function showValues(){ var a=new Array; <?php for($i=0;$i<count($a);...
read more

ASCII example

You might have visited many sites related to songs or movies, you might have noticed that the searching is in Alphabetical order, so what will you do if you want such listing, write all the characters from A to Z ?. There is an easy way for implementing this in PHP. We can use function ord() and chr(). ord – Return ASCII value of character. chr – Return a specific character. I am attaching a simple...
read more

top