SpongeBobby
08-18-2002, 02:55 AM
Can someone tell me what i am missing here, it dont seem to work for me. I am completely new to Java..so if i miss something stupid...you'll know.
<SCRIPT LANGUAGE="JavaScript">
*/
document.write("<FORM><INPUT TYPE=HIDDEN NAME='saved' value='1'></FORM>")
function welcome()
{
if(document.cookie == "")
{
var counting = "1";
var when = new Date()
document.cookie = "counting=; expires=" + when.toGMTString();
when.setMonth(when.getMonth() + 1)
var counting = document.forms[0].saved.value;
document.cookie = "counting="+counting+" `; expires=" + when.toGMTString()
document.write("Welcome to my homepage.");
}
else
{
var get = document.cookie;
get = get.substring((get.indexOf("=")+1),get.length);
var count = get.split(" ");
count[0]++
document.write("Thanks for coming back! You have been here "+count[0]+" times.");
document.forms[0].saved.value=count[0];
saveit()
}
}
function saveit()
{
var when = new Date()
document.cookie = "counting=; expires=" + when.toGMTString();
when.setMonth(when.getMonth() + 1)
var counting = document.forms[0].saved.value;
document.cookie = "counting="+counting+"; expires=" + when.toGMTString()
}
welcome()
</SCRIPT>
Thanks,
<SCRIPT LANGUAGE="JavaScript">
*/
document.write("<FORM><INPUT TYPE=HIDDEN NAME='saved' value='1'></FORM>")
function welcome()
{
if(document.cookie == "")
{
var counting = "1";
var when = new Date()
document.cookie = "counting=; expires=" + when.toGMTString();
when.setMonth(when.getMonth() + 1)
var counting = document.forms[0].saved.value;
document.cookie = "counting="+counting+" `; expires=" + when.toGMTString()
document.write("Welcome to my homepage.");
}
else
{
var get = document.cookie;
get = get.substring((get.indexOf("=")+1),get.length);
var count = get.split(" ");
count[0]++
document.write("Thanks for coming back! You have been here "+count[0]+" times.");
document.forms[0].saved.value=count[0];
saveit()
}
}
function saveit()
{
var when = new Date()
document.cookie = "counting=; expires=" + when.toGMTString();
when.setMonth(when.getMonth() + 1)
var counting = document.forms[0].saved.value;
document.cookie = "counting="+counting+"; expires=" + when.toGMTString()
}
welcome()
</SCRIPT>
Thanks,