registration.asp:::
<% connection%>
<%if request.QueryString("insert")<>"" then
'if request.QueryString("rbnMale")=="on" then
' gender="Male"
' else if request.QueryString("rbnFemale")=="on" then
' gender="Female"
' end if
gender="male"
qry="insert into registration(Username,Password,FirstName,LastName,Address,Place,LandPhone,MobilePhone,Email,Gender,Qualification)values('"+request.Form("txtUsername")+"','"+request.Form("txtPassword")+"','"+request.Form("txtFirstName")+"','"+request.Form("txtLastName")+"','"+request.Form("txtAddress")+"','"+request.Form("txtPlace")+"',"+request.Form("txtlandPhone")+","+request.Form("txtMobile")+",'"+request.Form("txtEmail")+"','"+gender+"','"+request.Form("txtQualification")+"')"
CON.Execute(qry)
Response.Redirect("ListUsers.asp")
end if
%>
<form id="form2" name="form2" method="post" action="Registration.asp?insert=1" >
<table width="286" border="1" align="center">
<tr>
<td width="87">UserName:</td>
<td width="183"><label>
<input name="txtUserName" type="text" id="txtUserName" />
</label></td>
</tr>
<tr>
<td>Password:</td>
<td><label>
<input type="password" name="txtPassword" id="txtPassword" />
</label></td>
</tr>
<tr>
<td>FirstName:</td>
<td><label>
<input type="text" name="txtFirstName" id="txtFirstName" />
</label></td>
</tr>
<tr>
<td>LastName:</td>
<td><label>
<input name="txtLastName" type="text" id="txtLastName"/>
</label></td>
</tr>
<tr>
<td>Address: </td>
<td><label>
<textarea name="txtAddress" id="txtAddress"></textarea>
</label></td>
</tr>
<tr>
<td>Place: </td>
<td><label>
<input type="text" name="txtPlace" id="txtPlace" />
</label></td>
</tr>
<tr>
<td>Country:</td>
<td><label>
<select name="lstCountry" id="lstCountry">
<option>India</option>
<option>China</option>
<option>USA</option>
</select>
</label></td>
</tr>
<tr>
<td>LandPhone:</td>
<td><label>
<input type="text" name="txtlandPhone" id="txtlandPhone" />
</label></td>
</tr>
<tr>
<td>Mobile:</td>
<td><label>
<input type="text" name="txtMobile" id="txtMobile" />
</label></td>
</tr>
<tr>
<td> Email:</td>
<td><label>
<input type="text" name="txtEmail" id="txtEmail" />
</label></td>
</tr>
<tr>
<td>Gender:</td>
<td><label>
<input type="radio" name="" id="rbnMale" value="rbnMale" />
Male
<input type="radio" name="radio" id="rbnFemale" value="rbnFemale" />
Female<br />
</label></td>
</tr>
<tr>
<td>Qualification:</td>
<td><label>
<input type="text" name="txtQualification" id="txtQualification" />
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="btnSubmit" id="btnSubmit" value="Submit"/>
</label></td>
</tr>
</table>
</form>
login:(try)::
<%
Response.Expires = -1000 'Makes the browser not cache this page
Response.Buffer = True 'Buffers the content so our Response.Redirect will work
Session("UserLoggedIn") = ""
If Request.Form("login") = "true" Then
CheckLogin
Else
ShowLogin
End If
Sub ShowLogin
%>
<form name="form1" action="login.asp" method=post>
User Name : <input type=text name=username><br>
Password : <input type=password name=userpwd><br>
<input type=hidden name=login value=true>
<input type=submit value="Login">
</form>
>%
End Sub
Sub CheckLogin
If LCase(Request.Form("username")) = "guest" And LCase(Request.Form("userpwd")) = "guest" Then
Session("UserLoggedIn") = "true"
Response.Redirect "protectedpage.asp"
Else
Response.Write("Login Failed.<br><br>")
ShowLogin
End If
End Sub
%>
list users:
<%connection%>
<%
'response.Write(request.QueryString("id"))
SQL="Select * from registration WHERE UserId=" & request.QueryString("id")
Set RS = Server.CreateObject("ADODB.Recordset")
RS.open SQL ,CON
if Not RS.EOF then
uname=RS("UserName")
fname=RS(3)
lname=RS(4)
addrs=RS(5)
place=RS(6)
country=RS(7)
lphone=RS(8)
mphone=RS(9)
email=RS(10)
gender=RS(11)
qualification=RS(13)
end If
'Response.Write("uname:" & uname)
'response.End()
%>
<form id="form2" name="form2" method="post" action="Editing1.asp?changes=1" >
<table width="286" border="1" align="center">
<tr>
<td width="87">UserName:</td>
<td width="183"><label>
<input name="txtUserName" type="text" id="txtUserName" value="<%=uname %>" />
</label></td>
</tr>
<tr>
<td>Password:</td>
<td><label>
<input type="password" name="txtPassword" id="txtPassword" />
</label></td>
</tr>
<tr>
<td>FirstName:</td>
<td><label>
<input type="text" name="txtFirstName" id="txtFirstName" value="<%=fname%>" />
</label></td>
</tr>
<tr>
<td>LastName:</td>
<td><label>
<input name="txtLastName" type="text" id="txtLastName" value="<%=lname%>"/>
</label></td>
</tr>
<tr>
<td>Address: </td>
<td><label>
<textarea name="txtAddress" id="txtAddress"><%=addrs%></textarea>
</label></td>
</tr>
<tr>
<td>Place: </td>
<td><label>
<input type="text" name="txtPlace" id="txtPlace" value="<%=place%>"/>
</label></td>
</tr>
<tr>
<td>Country:</td>
<td><label>
<input type="text" name="txtCountry" id="txtCountry" value="<%=country%>" />
</label></td>
</tr>
<tr>
<td>LandPhone:</td>
<td><label>
<input type="text" name="txtlandPhone" id="txtlandPhone" value="<%=lphone%>"/>
</label></td>
</tr>
<tr>
<td>Mobile:</td>
<td><label>
<input type="text" name="txtMobile" id="txtMobile" value="<%=mphone%>" />
</label></td>
</tr>
<tr>
<td> Email:</td>
<td><label>
<input type="text" name="txtEmail" id="txtEmail" value="<%=email%>"/>
</label></td>
</tr>
<tr>
<td>Gender:</td>
<td><label>
<input type="text" name="txtGender" id="txtGender" value="<%=gender%>"/>
</label></td>
</tr>
<tr>
<td>Qualification:</td>
<td><label>
<input type="text" name="txtQualification" id="txtQualification" value="<%=qualification%>"/>
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="btnSubmit" id="btnSubmit" value="Submit"/>
</label></td>
</tr>
</table>
</form>