Monthly Archives: June 2011

Javascript print() function

Javascript window.print() used to take print the current web page.When the user click ‘Print’ button the user will get the print window. Code: <head> <script language="javascript"> function takeprint() { window.print(); } </sctipt> </head> <body> <input type="button" name="print" value="Print" onClick="javascript:return takeprint();">

Posted in Javascript

PHP mysql_insert_id

The mysql_insert_id() function returns the AUTO_INCREMENT ID generated from the previous INSERT operation. Syntax mysql_insert_id($connectionlink); You can refer this link http://qualitypointtech.net/forum/viewtopic.php?f=25&t=365 for knowing more about this function and example.

Posted in Php

Get current Page Name in php

The basename($_SERVER[‘PHP_SELF’]) function is used to get current pagename only. basename($_SERVER[‘PHP_SELF’]); You can refer this link http://qualitypointtech.net/forum/viewtopic.php?f=25&t=366 for more information.

Posted in Php

Getting previous day/month/year records from mysql table

In this post will explain how to get Today, yesterday, last one month record, last year record from database table using Mysql query. Here I have used the MySQL function CURDATE() to get the today’s date. And also to get

Posted in MySQL

Solution for fixing trim() function in javascript not working in IE

Solution for fixing trim() function in javascript not working in IE I tired to apply trim() function in Javascript for one of my code. Its working fine under mozilla. But error display once I tried in IE7. I have tried

Posted in Javascript

Getting Previous page url in php

In this post will explain how to get previous page url using php. In php it have built-in function for getting previous page url. Example: <?php $_SERVER['HTTP_REFERER']; // return the previous page url. ?>

Posted in Php

Dynamically adding text box using javascript

Some times we need to add text box dynamically in a web page. For example, assume that our web page is having option to add email id of many friends. It is very difficult to judge how many friends will

Posted in Javascript

Select and Deselect the checkboxes using jQuery

In this post will explain how to select and deselect the checkboxes using jQuery Assume the html code have some set of checkboxes, and two buttons ‘Select all’, ‘Deselect all’. Now I want whenever user selects “Select all” then it

Posted in jQuery

How to get last key in an array?

In this post will explain how to get last key in an array using php. A solution would be using both end() and key(). end() – point array ‘s internal pointer to the last element, and returns its value. key()

Posted in Php

JavaScript Search

The search() method searches for a match between a regular expression and a string. This method returns the position of the match, or -1 if no match is found. Syntax string.search(regexp) Let’s see small example, <script language="javascript"> function findmatch() {

Posted in Javascript