Show DevBest a type of log in system [html]

Status
Not open for further replies.

extacy

Member
Jan 6, 2011
106
2
So when you have this code on your site and its your first time being there with the script, what is does is asks for your name, and then you type it in and press okay, but then nothing happends? well press F5 and it will say Welcome and the name you put in
all you do is put this on your index.html and it is perfect!
HTML:
<html>
<head>
<script type="text/javascript">
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
  {
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}

function checkCookie()
{
var username=getCookie("username");
if (username!=null && username!="")
  {
  alert("Welcome again " + username);
  }
else 
  {
  username=prompt("Please enter your name:","");
  if (username!=null && username!="")
    {
    setCookie("username",username,365);
    }
  }
}
</script>
</head>
<body onload="checkCookie()">
</body>
</html>
Too see how this works go too: it has that same thing on there!
Credit:
me- 50% uploading to a site and some coding
mace- the other half of coding (lol)
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
I don't really understand what this is - A color generator or a Login system, because if it is a login system, then you have uploaded the wrong thing.
 

FL4

Member
Sep 19, 2010
452
29
Leads to a colour generator site not a 'Log in System'

Please upload a working version of this Log in System

Well we will find out im putting on my site if it dose ill make the post of this with the site
 

AyJay

Member
Sep 12, 2010
239
8
Guys who want a real test, Here one is:



Doesent work, It fails, No password function, Username is allways wrong, It's crap... Close thread.
 
Status
Not open for further replies.

Users who are viewing this thread

Top