For the following code when ever i open the this page the text box has /
i ahve set the value of text box with session variables whic is exuted only when submit button is clicked....Pls Help me....
i ahve set the value of text box with session variables whic is exuted only when submit button is clicked....Pls Help me....
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>REGISTRATION</title>
<script language="javascript" src="validate.js" type="text/javascript"></script>
</head>
<body>
<h4><b>WELCOME TO REGISTRATION PAGE</b></h4>
<form id="registration" name="registration" method="post" onsubmit="return ValidateForm();">
<table width="346">
<tr><br />
<td width="338" align="Center"><h2 align="center">REGISTRATION</h2></td>
</tr>
<tr>
<td width="338" align="center" nowrap="nowrap"><h4 align="left">User Name:
<input name="txtuname" type="text" value=<%=session("username")%> /> <h4 align="left">First Name:
<input name="txtfname" type="text" value=<%=session("fname")%> />
</h4></td>
</tr>
<tr>
<td width="338" align="center"><h4 align="left">Last Name:
<input name="txtlname" type="text" value=<%=session("lname")%> />
</h4></td>
</tr>
<tr>
<td align="center" ><h4 align="left">Password:
<input name="txtpassword" type="password" value=<%=session("password")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">EMAIL ID:
<input name="txtemail" type="text" value=<%=session("mail")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">Phone No:
<input name="txtphno" type="text" value=<%=session("phno")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">Mobile No:
<input name="txtmno" type="text" value=<%=session("mno")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">Address:
<textarea name="txtadd1" wrap="physical" value=<%=session("add1")%>></textarea>
</h4></td>
</tr>
<% response.Write(session("mail"))%>
<tr>
<td align="center"><h4 align="left">Address2:
<textarea name="txtadd2" value=<%=session("add2")%>></textarea>
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">City:
<input name="txtcity" type="text" value=<%=session("city")%>/>
</h4></td>
</tr><tr>
<td align="center"><h4 align="left">State:
<input name="txtstate" type="text" value=<%=session("state")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">Country:
<input name="txtcountry" type="text" value=<%=session("country")%> />
</h4></td>
</tr>
<tr>
<td align="center"><h4 align="left">Zip code:
<input name="txtzip" type="text" value="<%=session("zip")%>" />
</h4></td>
</tr>
<tr><br />
<td align="center"><input name="btnsubmit" type="submit" id="btnsubmit" value="Submit" />
<input type="reset" /> </td>
</tr>
</table>
</form>
</body>
</html>
<%
if(request.form("btnsubmit")<>"") then
mail=request.form("txtemail")
id=request.form("txtuname")
set conn=server.CreateObject("ADODB.connection")
conn.Mode = 3
ConnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=Rajesh;Port=3306;DATABASE=agstc2008;UID=root;PWD=sa;character set=utf8;"
conn.open ConnString
set rs=server.CreateObject("ADODB.recordset")
query="select * from tbluser"
Set rs = conn.execute(query)
no=2
while not RS.EOF
if rs("userEmailId")=mail OR rs("userId")=id THEN
Response.Write("EMAIL ID/USER ID ALREADY EXISTS")
session("username")=request.form("txtuname")
session("password")=request.form("txtpassword")
session("fname")=request.form("txtfname")
session("lname")=request.form("txtlname")
session("email")=request.form("txtemail")
session("phno")=request.form("txtphno")
session("mno")=request.form("txtmno")
session("add1")=request.form("txtadd1")
session("add2")=request.form("txtadd2")
session("city")=request.form("txtcity")
session("state")=request.form("txtstate")
session("country")=request.form("txtcountry")
session("zip")=request.form("txtzip")
no=1
end if
rs.movenext
wend
if(no=2) then
session("username")=request.form("txtuname")
session("password")=request.form("txtpassword")
session("fname")=request.form("txtfname")
session("lname")=request.form("txtlname")
session("email")=request.form("txtemail")
session("phno")=request.form("txtphno")
session("mno")=request.form("txtmno")
session("add1")=request.form("txtadd1")
session("add2")=request.form("txtadd2")
session("city")=request.form("txtcity")
session("state")=request.form("txtstate")
session("country")=request.form("txtcountry")
session("zip")=request.form("txtzip")
response.Redirect("lsucess.asp")
end if
rs.close
conn.close
end if
%>
Comment