Login Feature for webpage

liunx

Guest
Hi All,<br />
<br />
Does anyone out there know how to make a username and password feature for websites?<br />
<br />
Thanks,<br />
<br />
Simon<!--content-->There are several ways to do this. Check into htaccess, cookies, and sessions (php). There are a lot of free tutorials and scripts to help you out. <br />
<!-- w --><a class="postlink" href="http://www.hotscripts.com">www.hotscripts.com</a><!-- w --> has tons of free scripts.<!--content-->Login.asp:<br />
-----------<br />
<br />
<%<br />
password = Request.Form("password")<br />
user = Request.Form("user")<br />
<br />
If Request.QueryString("cat") = "login" THEN<br />
If user = "yourusername" AND password = "yourpassword" THEN <br />
Session("control") = "YES"<br />
Session("name") = Request.Form("user")<br />
response.Redirect "loggedin.asp" <br />
END IF<br />
END IF<br />
%><br />
<%<br />
If Request.Querystring("cat") = "logout" Then<br />
Session.Abandon<br />
Response.Redirect "login.asp"<br />
End If<br />
%><br />
<br />
<html><br />
<br />
<head><br />
<title>My login-page</title><br />
</head><br />
<body><br />
<table border="0" cellpadding="0" cellspacing="0" width="100%"><br />
<form name="form" method="post" action="login.asp?cat=login"><br />
<tr><br />
<td width="100%"><br><br />
Username:</td><br />
</tr><br />
<tr><br />
<td width="100%"><br />
<input type="text" name="user" size="32"></td><br />
</tr><br />
<tr><br />
<td width="100%">Password:</td><br />
</tr><br />
<tr><br />
<td width="100%"><br />
<input type="password" name="password" size="32"></td><br />
</tr><br />
<tr><br />
<td width="100%"><br><br />
<input type="submit" name="submit" value="Log in"></td><br />
</tr><br />
</table><br />
<br />
</body><br />
<br />
</html><br />
<br />
-------------<br />
loggedin.asp<br />
-------------------<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"login.asp?cat=logout">Log out</a><!--content-->Guyz,<br />
<br />
Thanks ALOT for the help!<br />
<br />
a note to god zilla: how would i be able to implement this on my site? sorri im a novice on this.<br />
<br />
Simon<!--content-->First you create a page called login.asp. Copy and paste the code I wrote in my previous reply.<br />
Then you create another page called loggedin.asp (this is the site you enter when you are logged in), and type:<br />
<br />
<html><br />
<head><br />
<title>Logged in</title><br />
<body bgcolor="#ffffff"><br />
<a href=http://www.htmlforums.com/archive/index.php/"login.asp?cat=logout">Log out</a><br />
</body><br />
</html><br />
<br />
In login.asp, in this row: If user = "yourusername" AND password = "yourpassword" THEN,<br />
you change the password and username.<br />
Hope I answered your question.. :)<!--content-->Yes, but your server must support the chosen serverside language, in this case ASP! There are some free servers that support them, e.g. Brinkster (<!-- m --><a class="postlink" href="http://www.brinkster.com">http://www.brinkster.com</a><!-- m -->) supports ASP.<!--content-->My bad. I forgot to mention that.:rolleyes: <br />
I have my own domain, so I kind of take it for granted. ;)<!--content-->Originally posted by God Zilla <br />
My bad. I forgot to mention that.:rolleyes: <br />
I have my own domain, so I kind of take it for granted. ;) <br />
Yes, glanby.se. I've been to your site.<br />
<br />
Den é–¶
 
Back
Top