Posts

search drop down list onmouseover event

Image
Hi friends Here you can see the code to get dropdown list onmouseover event using javascript <script type="text/javascript"> var timeout    = 100; var closetimer    = 0; var ddmenuitem    = 0; function mopen(id) {     // cancel close timer     mcancelclosetime();     // close old layer     if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';     // get new layer and show it     ddmenuitem = document.getElementById(id);     if(ddmenuitem)         ddmenuitem.style.visibility = 'visible'; } function mclose() {     if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } function mclosetime() {     closetimer = window.setTimeout(mclose, timeout); } function mcancelclosetime() {     if(closetimer)     {   ...

get searching data from google on localhost

Hi friends, Try this to get search data on your local host. <?php $text = $_POST['search']; ?> <form action="searchbygoogle.php" method="POST"> <input name="search" type="text" value="<?= $text;?>" /> <input type="submit" value="Search" /> </form> if ($_POST['search']==""){ echo "No search data found"; } else{ $query = file_get_contents("http://www.google.com/search?q=".urlencode($_POST['search'])."&hl=en&ie=UTF-8&filter=2"); //needs to be added with more queries $replace_array = array('/\n/','/(.*)<\/head>/','/(.*) /','/ (.*)/'); //pregraplacing unneeded parts $results = preg_replace($replace_array, '', $query); echo $results; } ?> </div>

export to excel in php

Image
Hi friends Excel files are great for many things. It might though be a little bit tricky to generate them on the fly with php. Therefor I will guide you exactly how to do it, quick and simple. Excel is a very useful format for lots of purposes. For example, exporting stats, member lists to hand over to economy department etc.   <?php echo "Export Data Using PHP"; echo ' <form action="'. $phpself.'"> '; echo '<input name="submit" type="submit" value="Export" /> </form> '; ?> } else { $dbc = mysql_connect("localhost","root",""); mysql_select_db("test",$dbc); $contents="ID,Title,Visit\n"; $user_query = mysql_query('select id,title,visit from wallpaper'); while($row = mysql_fetch_array($user_query)) { $contents.=$row[0].","; $contents.=$row[1].","; $contents.=$row[2]."\n"; } ...

get time difference in php

Image
Date and time is one function which is always like there in whatever website, project you create. The more simple they look like to start with the more complex they become. Complexity comes in when we put these functions into different loops conditions etc.  The line below show you how you can call function. The function expects to be given 2 strings representing the start and end values of a time or date. <?php echo 'Hi! My name is Ankit Kumar Chauhan. I am: '.getDifference(date("Y-m-d G:i:s"),'1985-10-02 00:00:00'). ' Years old.'; function getDifference($startDate,$endDate,$format = 6) {     list($date,$time) = explode(' ',$endDate);     $startdate = explode("-",$date);     $starttime = explode(":",$time);     list($date,$time) = explode(' ',$startDate);     $enddate = explode("-",$date);     $endtime = explode(":",$time);     $secondsDifference = mktime(...

encryption in java

Image
The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency (NSA) and published by the NIST as a U.S. Federal Information Processing Standard. SHA stands for Secure Hash Algorithm. The three SHA algorithms are structured differently and are distinguished as SHA-0 , SHA-1 , and SHA-2 . The SHA-2 family uses an identical algorithm with a variable digest size which is distinguished as SHA-224 , SHA-256 , SHA-384 , and SHA-512 .   SHA-1 : The Secure Hash Algorithm (SHA) was developed by NIST and is specified in the Secure Hash Standard (SHS, FIPS 180). SHA-1 is a revision to this version and was published in 1994. It is also described in the ANSI X9.30 (part 2) standard. SHA-1 produces a 160-bit (20 byte) message digest. Although slower than MD5, this larger digest size makes it stronger against brute force attacks. MD5 : MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16 byte) message digest makes it a fas...

How to get google to index images quickly

Pictures are a valuable way to attract visitors to your site, because visitors search for them using Google, Yahoo and Bing image search. When an image is placed on a page, there is a space for two tags called ALT and TITLE. These tags are displayed to the user when the mouse hovers over a picture. Both an ALT and a TITLE tag are needed.   Before going to indexing, you should confirm about your images that they are visible google crawler So how will you check it Go to: http://www.smart-it-consulting.com/internet/google/googlebot-spoofer/ Some Guideline are here:- Give proper alt, title to the image Define the size(width and height) of image Each image must have unique alt tag Don't use src="images/abc.jpg". Better one is to used src="htttp://www.domain.com/images/abc.jpg" So you have to use full image path to display image in google search.

sum of matrix in java

Image
In this program we are going to calculate the sum of two matrix. To make this program, we need to declare two dimensional array of type integer. Firstly it calculates the length of the both the arrays. Now we need to make a matrix out of it. To make the matrix we will use the for loop. By making use of the for loop the rows and column will get divide. This process will be performed again for creating the second matrix. After getting both the matrix with us, we need to sum both the matrix. The both matrix will be added by using the for loop with array[i][j]+array1[i][j]. The output will be displayed by using the println() method. class summatrix {     public static void main(String[] args)              {             int array[][]= {{4,5,6},{6,8,9}};             int array1[][]= {{5,4,6},{5,6,7}};  ...