2009
08.27

Page Peel Ads or Peel Away Ads are a non-distracting form of advertising. You have seen the corner ads that tempt you to peel them away to see what is underneath. Mostly websites like selling single software product or forums uses this.

First we check how it works.

Here’s How It Works.

The customer sees a small animated “peel” on the top right corner of a page.
image_1

Once he or she passes his mouse over it the Web site”Peels Away” to show the Ad.
image_2

Now here is code which i have taken from lots of website and modified it according to my need. This code works perfect in IE 6 & 7, Mozilla and Chrome. I have not tested other browsers.

I am not claiming that this code is purely mine and i have developed it totally but it was free and i did modification and put on this website for help of people who wants to make such type of advertisement on their website without paying a single penny.

First Download code from here

Unpacked Zip archive on your hard disk.

Create two image with size of 75×75 pixel and 500×500 pixel in .gif format.

Edit the file corner.js with a text editor. Change the URLs to the .swf files and the .gif images. For example, if you want to set up on http://www.my_site_name.com/, the URLs must point there.

Include corner.js file in html file after and before tag. If you add it before tag, it won’t work on Internet Explorer
example of code will be like

Here is once again explanation of which code to change in corner.js file


var jcorner987 = new Object();
jcorner987.ad_url = escape('Link');
jcorner987.small_path = 'http://www.my_site_name.com/small.swf';
jcorner987.small_image = escape('http://www.my_site_name.com/11.gif');
jcorner987.small_width = '100';
jcorner987.small_height = '100';
jcorner987.small_params = 'ico=' + jcorner987.small_image;
jcorner987.big_path = 'http://www.my_site_name.com/big.swf';
jcorner987.big_image = escape('http://www.my_site_name.com/1.gif');
jcorner987.big_width = '650';
jcorner987.big_height = '650';
jcorner987.big_params = 'big=' + jcorner987.big_image + '&ad_url=' + jcorner987.ad_url;

If you like my efforts and script, than a back link would be nice.

2009
08.04

Few days ago i get 15MB .sql file in which only one table was there with data. My task is to just import those data in database. Now i have phpMyAdmin but it can allow me 8MB of file. Even i do not have any other support on server. So now i have to write my code or find some code on internet. I tried but dont get any proper solution. so i decided to write my own code. I have used this code to import full databases also for testing.

Here is code


<?php

// file name to import
$sqlfile = 'myfile.sql';
$mysql_host = 'localhost';
$mysql_username = 'root';
$mysql_password = '';
$mysql_database = 'database_name';

mysql_connect($mysql_host, $mysql_username, $mysql_password);
mysql_select_db($mysql_database);

// define Temporary variable.
$temp = '';

// read file
$lines = file($sqlfile);

// get line by line loop from file
foreach ($lines as $line)
{
	// we have to omit comment.
	if (substr($line, 0, 2) == '--' || $line == '')
		continue;

	// if it not comment than save it in $temp variable
	$temp. = $line;

	// If we get a semicolon at the end of line than
	if (substr(trim($line), -1, 1) == ';')
	{
		// Perform the query
		mysql_query($temp);
		// set temp variable to empty
		$temp = '';
	}
}
?>
Rss Feed Tweeter button Facebook button Linkedin button