Posts

Featured post

Simple Pagination using jquery,mySql and PHP

Image
In this post we are going to learn about pagination using jQuery,MySQL and PHP.This is very simple tutorial.It has four files which are as below. (1) config.php file     - For the database connection details. (2) index.php file     - Main file that display the result to the user. (3) data.php file     - File having code to fetch the data from the table. (4) pagination.js file     - Javascript file for acting as a data controller Download Full Source Create Database table CREATE TABLE IF NOT EXISTS `users`(  `id` int(10) NOT NULL AUTO_INCREMENT,  `FirstName` varchar(200) NOT NULL,  `Middlename` varchar(200) NOT NULL,  `LastName` varchar(200) NOT NULL,  PRIMARY KEY (`id`) ) config.php file Change the values of hostname,username,password and database name <?php $mysql_hostname = "localhost";  $mysql_user = "root";  $mysql_password = "";  $mysql_database = "test";  $con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Op

Add Read More Link When Someone Copy Paste Your Content

Image
Few days before when i was surfing for the latest news and I noticed(you may have also noticed that) if you copy and paste any text from the site a reference link is added at the bottom of the copied content,indicating the source from where you have copied that.  I was surprised and was sure that i have copied only content then how that link also copied and then tried to figure out how it happened and how to do it. I figured out that they use a service called " Tynt ". Ya its cool but who wanted to use it.After all we are developers so i just wanted to see if we could make it happen by using JavaScript and hurray it was possible.  One function needs to grab the copied selection, tack on a copyright notice and then add the two to the clipboard.  <script type="text/javascript"> function addLink() {      var body_element = document.getElementsByTagName('body')[0];      var selection;      selection = window.getSelection(); var pagelink = "<br />

Add Meta Description and Meta Keywords in opencart

Image
In this tutorial we will see how to add meta description and meta keywords in opencart.Just follow the steps given below. Step 1 : Add new fields "Meta Keywords" and "Meta Description" in the database In order to add Meta Keywords and Meta Description in pages we first have to add Meta Description and Meta Keywords  fields into the database in the table called as information_description. Simply Run the following query: ALTER TABLE `information_description` ADD `meta_description` VARCHAR( 255 ) NOT NULL, ADD `meta_keywords` VARCHAR( 255 ) NOT NULL Note: please consider if you have database prefix or not.(Example: oc_) if so then use "oc_information_description. Step 2 : Add two Text boxes in admin panel Go to : admin/view/template/catalog/information_form.tpl file and search for the $entry_description code and insert the code given below just before it: <tr>    <td><?php //echo $entry_meta_description;?>Meta Description</td>    <td>

Decrease Page Loading Time

Image
Today we are going to talk about how to improve web page speed or how to decrease the loading time. Generally Users are enamored with speedy websites, and if  any  site responds very  slowly, visitors lose their patience and are less likely to come back. Improvement in page loading speed is not only useful for the site users but also for the search engine rankings as well. Google announced that from now website speed will also be included in their search ranking algorithms. So below are some of the solutions which help you in decreasing web page load time. 1. Website’s  Current Speed Analysis The very first thing that is required  is to analyze your current web  page speed. This will allow you to track improvements and ensure that changes mae by you improves page load times. So many free tools are available to check how much time your site takes to load.Below are a few of them: • Pingdom :  provide an easy  site speed test that which shows the way a page is loaded in a web browser. •

How to open Galaxy S4 configuration emulator

Image
How to open Galaxy S4 AVD: Google has not released Galaxy S4 configured built in emulator. It is not available in android SDK. So it is very tough to test app in this configuration basically for who does not have the real Galaxy S4 device. I don’t have this device but I like to test my app in Galaxy S4. In this tutorial I am trying to help to create Galaxy S4 configuration emulator.    Caution: As Galaxy S4 is not available now in android SDK so it will not give you proper feel and behavior.   To get the same behavior it is recommended to use the real device. S4 device screen is HD so your desktop or laptop screen will have to be HD resolution capability if at least you want to create S4 avd.   How to open Galaxy S4 AVD: At first click on the Virtual device manager and set the following attributes like the image below.   Now you are ready to run your Galaxy S4 AVD.   Problems in opening Galaxy S4 AVD: I have seen many developers complain that they did not able to open S4 co

5 Best tools for Web Developers And Designers

Image
Web designing and web development are two professions that are highly on demand in today’s age and time. With the help of the several tools, web designers and developers are in an advantageous position to create the best looking sites today. Dreamweaver : One of the most trusted web development tools that have been with the developers for a long time is Dreamweaver. It gives users a one-stop-shop feel to designers who can use the tool to create almost any kind of site. Photoshop : Photoshop needs no introduction. From designing attractive logos to creating web templates, this is a must-have tool for all. CoffeeCup Free HTML Editor : CoffeeCup Free HTML Editor is a tool that is perfect for beginners. It has all the basic HTML requirement but a few essential tools are missing such as CSS menu, FTP upload etc. Brackets : Brackets is an open source code editor which can be used by web developers to write HTML, CSS and JavaScript-based code. Foundation by Zurb : Foundation is a

Multiple Images Upload in CakePHP

Image
In this post we will see how to uload multiple images in cakephp.I am going to show the additional code for multiple image handling for both the action Add and Edit.What all you need is to simply copy paste in your application according to needs. My table : posts CREATE TABLE `posts` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL, `body` text NOT NULL, `image1` varchar(200),  `image2` varchar(200),  `image3` varchar(200), PRIMARY KEY (`id`) ) As you can see what are the fields of my 'posts' table.I have three fields for the images.Example: image1,image2,image3 etc.You may have different fields. Add the code given below for multiple image handling. My uploaded images are stored in  app/webroot/img/uploads/posts  folder.I have one default image called 'no-icon.jpg' in the same folder which will be shown if the correct image is not available or in case of NULL value. Controller : PostsController.php Add Function public function add() { $this->Po