home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
202.53.64.216
/
202.53.64.216.tar
/
202.53.64.216
/
janahitha
/
AdsRegister.asp
< prev
next >
Wrap
Text File
|
2004-11-26
|
9KB
|
248 lines
<!-- #include file="AdsOpenConn.asp" -->
<%
if request.form.count=0 then
%>
<html>
<head>
<title> Janahitha Ads - New Registration </title>
<meta name="author" content="Jagadish,Gopi">
<script language="javascript" src="func.js"></script>
<script language="javascript">
function check()
{
validateform = document.registrationform;
if(isempty(validateform.loginid))
validateform.loginid.focus();
else
if(isempty(validateform.password))
validateform.password.focus();
else
if(isempty(validateform.passward))
validateform.passward.focus();
else
if(validateform.password.value!=validateform.passward.value)
{
alert("Password Does Not Match ! Enter Again !!");
validateform.passward.focus();
}
else
if(isempty(validateform.name))
validateform.name.focus();
else
if(isempty(validateform.contactperson))
validateform.contactperson.focus();
else
if(isempty(validateform.address))
validateform.address.focus();
else
if(isempty(validateform.city))
validateform.city.focus();
else
if(isempty(validateform.state))
validateform.state.focus();
else
if(isempty(validateform.pincode))
validateform.pincode.focus();
else
if(!(ispin(validateform.pincode)))
validateform.pincode.focus();
else
if(isempty(validateform.phone1))
validateform.phone1.focus();
// else
//if(isempty(validateform.phone2))
// validateform.phone2.focus();
else
if(!(isemail(validateform.email)))
validateform.email.focus();
else
validateform.submit();
}
</script>
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<!-- #include file="AdsTop.asp" -->
<center>
<table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
<tr>
<td width=150 align=center valign=top bgcolor="#FFFFFF">
<!-- #include file="AdsLeft.asp" -->
</td>
<td width=630 align=center valign=top bgcolor="#ffffff">
<br>
<form name="registrationform" method=post action="<%=request.servervariables("script_name")%>">
<font face="verdana" color="#99603E"> <b> New Registration </b> </font> <br> <br>
<table cellpadding=0 cellspacing=0 border=0 width="368">
<tr> <td bgcolor="#f2D197">
<table cellspacing=1 cellpadding=3 border=0 width=362>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Login Id <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="loginid" size="15" maxlength=20>
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Password <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=password name="password" size="15" maxlength=20>
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Confirm Password
<b><font color="#FF0000">*</font></b></font> </td>
<td width="116">
<input type=password name="passward" size="15" maxlength=20> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Organization <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="name" size="15" maxlength=50> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Contact Person
Name <b><font color="#FF0000">*</font></b></font> </td>
<td width="116">
<input type=text name="contactperson" size="15" maxlength=50> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Address <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="address" size="15" maxlength=200> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> City <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="city" size="15" maxlength=50> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> State <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="state" size="15" maxlength=50> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Pin <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="pincode" size="15" maxlength=6> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Phone1 <b><font color="#FF0000">*</font></b></font>
</td>
<td width="116">
<input type=text name="phone1" size="15" maxlength=30> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Phone2 </font>
</td>
<td width="116">
<input type=text name="phone2" size="15" maxlength=30> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Fax </font>
</td>
<td width="116">
<input type=text name="fax" size="15" maxlength=30> </td>
</tr>
<tr bgcolor="#ffffff">
<td width="231"> <font face="verdana" size=2> Email <b><font color="#FF0000">*</font></b> </font>
</td>
<td width="116">
<input type=text name="email" size="15" maxlength=50> </td>
</tr>
</table>
</td> </tr>
</table>
<br>
<input type=button onclick="javascript:check()" value=" Register " id=button1 name=button1>
</form>
</td>
</tr>
</table>
</center>
<!-- #include file="AdsBottom.asp" -->
</body>
</html>
<%
else
loginid = replace(trim(request.form("loginid")), "'", "''")
password = replace(trim(request.form("password")), "'", "''")
name = replace(trim(request.form("name")), "'", "''")
address = replace(trim(request.form("address")), "'", "''")
city = replace(trim(request.form("city")), "'", "''")
state = replace(trim(request.form("state")), "'", "''")
pincode = replace(trim(request.form("pincode")), "'", "''")
phone1 = replace(trim(request.form("phone1")), "'", "''")
phone2 = replace(trim(request.form("phone2")), "'", "''")
fax = replace(trim(request.form("fax")), "'", "''")
email = replace(trim(request.form("email")), "'", "''")
contactperson = replace(trim(request.form("contactperson")), "'", "''")
set rs = server.createobject("adodb.recordset")
flag = true
rs.open "select count(*) from ClientMaster where ClientLoginId='" + loginid + "'", con
if rs(0)>0 then flag = false
rs.close
set rs = nothing
if flag=false then
%>
<html>
<head>
<title> Janahitha Ads - Welcome </title>
<meta name="author" content="Jagadish,Gopi">
</head>
<body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
<!-- #include file="AdsTop.asp" -->
<center>
<table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
<tr>
<td width=150 align=center valign=top bgcolor="#FFFFFF">
<!-- #include file="AdsLeft.asp" -->
</td>
<td width=630 align=center valign=top bgcolor="#ffffff">
<font face=verdana size=2 color=red>
<b> Login Id, <%=Request.Form("loginid")%> Already Exists <br> <br>
Hit <a href="javascript:history.back();"><font color=red>Back</font></a> To Enter Another</b>
</font>
</td>
</tr>
</table>
</center>
<!-- #include file="AdsBottom.asp" -->
</body>
</html>
<%
response.end
end if
sql1 = "insert into ClientMaster(ClientLoginId, ClientPassword, ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone1, ClientContactPerson"
sql2 = ") values('" + loginid + "', '" + password + "', '" + name + "', '" + address + "', '" + city + "', '" + state + "', '" + pincode + "', '" + phone1 + "','" +contactperson + "'"
if fax<>"" then
sql1 = sql1 + ", ClientFax"
sql2 = sql2 + ", '" + fax + "'"
end if
if phone2<>"" then
sql1 = sql1 + ", ClientPhone2"
sql2 = sql2 + ", '" + phone2 + "'"
end if
if email<>"" then
sql1 = sql1 + ", ClientEmail"
sql2 = sql2 + ", '" + email + "'"
end if
sql = sql1 + sql2 + ")"
con.execute sql
set rs = server.CreateObject("adodb.recordset")
rs.Open "select ClientId from ClientMaster where ClientLoginId='" + loginid + "'", con, 3, 3
session("ClientId") = cstr(rs("ClientId"))
rs.close
session("ClientLoginId") = loginid
session("ClientName") = name
response.redirect "AdsMyPage.asp"
end if
%>
<!-- #include file="AdsCloseConn.asp" -->