Posts

Showing posts from September, 2013

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, $...

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(); v...

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 wa...