Hi guys im setting up a members only section for my website and ive got the register form working fine (well the user can enter a username and password into a database) but now i dont know how to enable the users to log in with this username and password. im new to asp, only been doing it a few weeks so i dont really know what im doing. Here is the code ive used to store the name and password.
<B>Your Username and Password Has Been Stored</B>
<% Response.Buffer=True %>
<html>
<head>
<title>Entry Added</title>
</head>
<body>
<%
Dim rs,conn
set conn=Server.CreateObject("ADODB.connection")
set rs=Server.CreateObject("ADODB.Recordset")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("register.mdb"))
au=request("new_username")
ap=request("new_password")
ae=request("new_email")
an=request("new_number")
sqlstr="insert into members values('" &au& "','"&ap& "','" &ae&"','" &an& "')"
rs.Open sqlstr,conn
set rs=Nothing
%>
You should try asp mail. Your host probably has a feature sililar to this as a service. Maybe some sample scripts:
Here is an example:
Code:
<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "1&1 Test"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "ABCDE Company", "hello@justonedomain.com"
Mail.Subject = "Website - Info Request"
Mail.BodyText = Request.Form("info")
if Mail.SendMail then
Response.Write "Your mail has already been sent..."
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>
<body>
<p>Thank You!!<br>
</body>
</html>
A basic version of a feedback form:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ASP Mail Test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body background="">
<table width="100%" border="0" align="center">
<tr class="medium">
<td width="54%" align="center" valign="top">
<form onSubmit="return ValidateForm()" method="post" action="forminfo.asp">
Email Address:: <input name="email" type="text" id="email" size="41"></p>
Comments:: <textarea name="info" cols="35" rows="10"></textarea></p>
<input class="fancybut" type="submit" name="Submit" value="Submit Form">
<input class="fancybut" type="reset" name="Submit2" value="Reset Form"></p>
</form></td>
<td width="16%" align="right" valign="top"></td>
</tr>
</table>
</body>
</html>
Bookmarks