Archive for the ‘php’ Category

When you install the phpmotion on your system you will find that captcha code is not showing on registration page. open includes/captcha.php and replace var $font = 'DoradoHeadline.ttf'; by var $font =...

Joomla provides some basic themes which are already installed in the templates folder. When any developer develop the CMS in the joomla , he use his own template with new design. On the index page $this->baseurl works well but when he want to own module...

Are you looking for a regular expression to make clickable url in the string? Yes!, you will get your solutions here: echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string); If you want to open url in new tab...

I installed Magento on my local server. When I tried to add new category then I got a fatel error. What I did and what I got: I click on catalog > Manage Categories I got Fatal error: Call to undefined method...

In most cases we need to upload something on server without refreshing the page. for example we want to upload an image from popup window. But it will refresh the page and we will lost our popup and its content... so for this type of problems we providing...

What is the GD library? GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and "wrappers" are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD...

Many times developer gets the time problem during project development. Because he works on date function which provides by PHP but site works on different server which time is different from developer country. So for this case you can use magento time...

Mostly time we need to create some variables at run time. because we do not want to write same line. For example you have an array like : $user_details = array( 'name' => 'test1', 'email' => 'test@example.com', 'phone_number' =>...

Sometimes we need to develop a website with Hindi font. But main problem is how to insert content in Hindi in admin panel. so here is a solution by this admin can enter content in Hindi font. It will work like: When admin type any word like 'welcm' and...

This is helpful during write the plugin or widget for...

many times we need to do operation on two column values and show in the admin panel. for this we have to follow these steps: 1. Add column in your Grid.php file: 2. Now create a folder in the AdminHtml folder with name 'Renderer' 3. Create a...

Many times we need to show all roles in a dropdown for our widget and we try to find in database but we are unable to get correct value.. so here I am providing a good solution to get all list of...

Javascript Trim Functions Use the code below to make trim a method of all Strings. These are useful to place in a global Javascript file included by all your pages. String.prototype.trim = function() { return...

If you want to show product thumbnail on any page in your requirement size then At the showing page : <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(100, 100) ?>" border="0"...

To create a site in multiple languages you should do two main things : Write this code after connection created in database file : mysql_query ( 'SET...

What is 301 redirect ? You have a website and its all pages are ranked in the search engine. And now you’ve moved these files to a new domain. What will happen in this scenario!!. You are sending the visitor to “Error 404 – File not found” page...

Hiding PHP file extension

July 27, 2009 | In: htaccess, php

Do you want to hide your web site’s server script identity ? If you don’t want to reveal the programming language ( server side script ) of your website to visitors of website so that any hacker or spammer will not be able to intrude or inject any...