Monday, January 13, 2014

Stop Domain Country - Specific URL Redirecting from Blog

Stop Domain Country - Specific URL Redirecting from Blog

Add the following code to <head> tag to stop Domain Country - Specific URL Redirecting from Blog or Blogspot.
<script type="text/javascript">
var blog = document.location.hostname;
var slug = document.location.pathname;
var ctld = blog.substr(blog.lastIndexOf("."));
if (ctld != ".com") {
var ncr = "http://" + blog.substr(0, blog.indexOf("."));
ncr += ".blogspot.com/ncr" + slug;
window.location.replace(ncr);
}
</script>

Wednesday, January 8, 2014

How to Freeze or Lock Columns and Rows in Excel 2007, 2010

How to Freeze or Lock Columns and Rows in Excel 2007, 2010?

Learn how to Lock or Freeze Columns and Rows using Freezing Panes in an Excel 2007, 2010.

1. Open your excel.

2. To lock both rows and columns, click the cell below and to the right of the rows and columns that you want to keep visible when you scroll.

3. Goto View tab, in the Window group and select the Freeze Panes.

Freeze or Lock Columns and Rows in Excel

4. Select the Options which you want to like to freeze.
  • To lock one row only, select Freeze Top Row.
  • To lock one column only, select Freeze First Column.
  • To lock more than one row or column, or to lock both rows and columns at the same time, select Freeze Panes.
thats it..

Tuesday, January 7, 2014

Lemon battery - How to Make a Lemon Powered Light Bulb

Lemon battery - How to Make a Lemon Powered Light Bulb

The lemon battery is called a voltaic battery, which changes chemical energy into electrical energy. This is the concept behind the lemon battery experiment.

Lemon battery - How to Make a Lemon Powered Light Bulb

Friday, January 3, 2014

Automatically Visit Websites?

Automatically Visit Websites?

// Set the array to the number of URLs
var url=new Array(4)
// Create the list of URLs
url[0] = "http://www.google.com"
url[1] = "http://www.
yahoo.com"
url[2] = "http://www.sandydk.blogspot.com"
url[3] = "http://www.sandydk.blogspot.in"
// Set the number of seconds between cycles
var seconds = 15
var i = 0
function winClose() {
popWindow.close()
}
function winOpen() {
popWindow = window.open(url[i], "Automatic", 'location=1,status=1,scrollbars=1,width=800,height=600')
self.setTimeout('winClose()', (seconds*1000)-5000)
i++
if (i==url.length) {
i = 0
}
}
var interval = setInterval(winOpen, seconds*1000)


Thursday, January 2, 2014

How to Prevent / Avoid Form Resubmitting in Php

How to Prevent / Avoid Form Resubmitting in PHP?

Simple method for preventing form resubmission using php.


<?php
if(!isset($_SESSION))
{
session_start();
}
if($_POST)
{
if($_SESSION['token'] == $_POST['token'])
{
echo $_POST['txt'];
echo ‘</br>Submitting’;
// Place form action code here
}
else
{
echo ‘Re Submitting’;
}
}
$_SESSION['token'] = $token = rand();
?>

<form name=”frm” action=”" method=”post” >
<input type=”text” name=”txt” />
<input type=”hidden” name=”token” value=”<?php echo $token; ?>” />
<input type=”submit” />
</form>


How to add common pages in html using Jquery

How to add common pages in html using Jquery?


Simple example for including common files in HTML. JQuery load() function is used for including common HTML files in multiple pages. An example for this is added here,

<html>
<head>
<title>Include Common Files in HTML</title>
<script src=“http://code.jquery.com/jquery-1.10.2.js”></script>
</head>
<body>
<div id=“header”></div><br />
<div id=“content”>
Main Content
</div><br />
<div id=“footer”></div>
<script>
$(“#header”).load(“header.html”);
$(“#footer”).load(“footer.html”);
</script>
</body>
</html>