HTML Page Loader

liunx

Guest
I have 5 html pages , i would like that each time a person enters the website a new page appears. anyone knows how to do that?<!--content-->it wouldnt be done using html would be done using a sssl such as php or javacript using cookies<br />
<br />
try using something like this<br />
<!-- m --><a class="postlink" href="http://javascript.internet.com/cookies/visits.html">http://javascript.internet.com/cookies/visits.html</a><!-- m --><br />
<br />
and instead of this bit<br />
<br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Begin<br />
document.write("You've been here <b>" + amt() + "</b> times.")<br />
// End --><br />
</SCRIPT><br />
<br />
use<br />
<br />
<br />
<SCRIPT TYPE="text/javascript"><br />
<!-- Begin<br />
var times = amt();<br />
if(times == 0) {<br />
window.location = "page1.htm";<br />
} else if(times == 1) {<br />
window.location = "page2.htm";<br />
} else if(times == 2) {<br />
window.location = "page3.htm";<br />
} else if(times == 3) {<br />
window.location = "page4.htm";<br />
} else {<br />
window.location = "page5.htm";<br />
}<br />
// End --><br />
</SCRIPT><!--content-->Hey, thanks,i try it out but i still dont get it, i this is a copy of what i did...<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br />
"http://www.w3.org/TR/html4/loose.dtd"><br />
<html><br />
<HEAD><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<br />
<!-- This script and many more are available free online at --><br />
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> --><br />
<br />
<!-- Begin<br />
function GetCookie (name) { <br />
var arg = name + "="; <br />
var alen = arg.length; <br />
var clen = document.cookie.length; <br />
var i = 0; <br />
while (i < clen) {<br />
var j = i + alen; <br />
if (document.cookie.substring(i, j) == arg) <br />
return getCookieVal (j); <br />
i = document.cookie.indexOf(" ", i) + 1; <br />
if (i == 0) break; <br />
} <br />
return null;<br />
}<br />
function SetCookie (name, value) { <br />
var argv = SetCookie.arguments; <br />
var argc = SetCookie.arguments.length; <br />
var expires = (argc > 2) ? argv[2] : null; <br />
var path = (argc > 3) ? argv[3] : null; <br />
var domain = (argc > 4) ? argv[4] : null; <br />
var secure = (argc > 5) ? argv[5] : false; <br />
document.cookie = name + "=" + escape (value) + <br />
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + <br />
((path == null) ? "" : ("; path=" + path)) + <br />
((domain == null) ? "" : ("; domain=" + domain)) + <br />
((secure == true) ? "; secure" : "");<br />
}<br />
function DeleteCookie (name) { <br />
var exp = new Date(); <br />
exp.setTime (exp.getTime() - 1); <br />
var cval = GetCookie (name); <br />
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();<br />
}<br />
var expDays = 30;<br />
var exp = new Date(); <br />
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));<br />
function amt(){<br />
var count = GetCookie('count')<br />
if(count == null) {<br />
SetCookie('count','1')<br />
return 1<br />
}<br />
else {<br />
var newcount = parseInt(count) + 1;<br />
DeleteCookie('count')<br />
SetCookie('count',newcount,exp)<br />
return count<br />
}<br />
}<br />
function getCookieVal(offset) {<br />
var endstr = document.cookie.indexOf (";", offset);<br />
if (endstr == -1)<br />
endstr = document.cookie.length;<br />
return unescape(document.cookie.substring(offset, endstr));<br />
}<br />
// End --><br />
</SCRIPT><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<title>Untitled Document</title><br />
</head><br />
<br />
<body><br />
<SCRIPT TYPE="text/javascript"> <br />
<!-- Begin <br />
var times = amt(); <br />
if(times == 0) { <br />
window.location = "page1.htm"; <br />
} else if(times == 1) { <br />
window.location = "page3.htm"; <br />
} else if(times == 2) { <br />
window.location = "page3.htm"; <br />
} else if(times == 3) { <br />
window.location = "page4.htm"; <br />
} else { <br />
window.location = "page5.htm"; <br />
} <br />
// End --> <br />
</SCRIPT><br />
<br />
<br />
</body><br />
</html><br />
<br />
<br />
Its there anything more that i need to edit?<br />
<br />
Let me know<!--content-->
 
Back
Top