i have a script which enable me to redirect the visitor to the GOOGLE.COM if they r viewing the page 2nd time in a day with same ip....what i want to do this rather to redirect to the GOOGLE.COM they page itself close if a visitor is viewing the page 2nd time in a day...HERE IS THE SCRIPT
Quote:
<script language ='javascript'>
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
/* Check the cookie and redirect if they have it set. */
sWhere = 'http://google.com'; // replace this with where you want them to be sent when they can't view page.
if(!readCookie('viewcheck')){
createCookie('viewcheck',1,1);
} else {
window.location = sWhere;
}
</script>
|
PLEASE GUYZZ HELP ME....!!!
