Free User Registration Form
<html><head><title>Register Form</title>
<SCRIPT language=javascript>
function formsubmit(myform)
{myform.submit()}
function checkform() {var message = "";
if (document.newForm.uname.value.length == 0) {
message = message + "- Username field is Null.\\n\\n";}
if (document.newForm.pword.value.length == 0) {
message = message + "- Password field is Null.\\n\\n";}
if (document.newForm.uname.value.length < 4) {
message = message + "- Username length can not be shorter than 5 characters.\\n\\n";}
if (document.newForm.pword.value.length < 4) {
message = message + "- Password length can not be shorter than 5 characters.\\n\\n";}
if ( message.length > 0 ) { // is there an error message?
message = "Please, fill the form completely :\\n\\n" + message ;
alert( message );
return false; }}
</SCRIPT></head><body><%
if request.form("func") = "Register" then Dim uname, pword, strCon, con, rec strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("users.mdb") uname = trim(request.form("uname")) pword = trim(request.form("pword")) Set con = server.createobject("adodb.connection") con.open strCon set rec = con.execute("SELECT uname from userlist where uname LIKE '"& uname &"';") if rec.eof then con.execute("INSERT INTO userlist (uname, pword) VALUES ('"& uname &"', '"& pword &"');") if err. response.write "Your account created !" else response.write "Username already in use, Please Choose Another !" end if rec.close set rec = nothing con.close set con = nothing else %>
<form method="POST" action="register.asp" name="newForm" onsubmit="return checkform()">
<table border="1" cellpadding="0">
<tr><td width="50%"><b> Username :</b></td>
<td width="50%"> <input type="text" name="uname" size="15"> </td></tr>
<tr><td width="50%"><b> Password :</b></td>
<td width="50%"> <input type="password" name="pword" size="10"> </td></tr>
</table>
<p><input type="submit" value="Register" name="func"></p></form>
<%end if%></body></html>



