Hej!
jag undrar om någon skulle kunna vara så snäll och skriva om mail scriptet som finns här till "aspSmartMail"
jag har inte lyckats. det e lite bråttom också....
----------------------------------------------------
<%@ Language=VBScript %>
<%
Option Explicit
'/************************************************************
'* register.asp *
'* copyright Simon Norris 2002 *
'* email: si@web-sn.com *
'* home page: http://www.web-sn.com *
'* *
'* You may use or modify this script for *
'* non-profit sites provided this copyright *
'* notice remains unchanged. *
'************************************************************/
Response.Expires = 0
Session.Timeout = 120
Response.Buffer = True
%>
<!--#include file="db.asp"-->
<!--#include file="../config.asp"-->
<%
Dim isAttempt, failed, isReg
isAttempt = Request.QueryString("l")
failed = False
isReg = "No"
If isAttempt = "y" Then
Dim strSQL, RS, usern, pass, pass2, forename, surname, email, fso, strSQLUpdate
Dim DBuNameExists, FSuNameExists
usern = Trim(Request.Form("flder"))
pass = Trim(Request.Form("pass"))
pass2 = Trim(Request.Form("pass2"))
forename = Trim(Request.Form("forename"))
surname = Trim(Request.Form("surname"))
email = Trim(Request.Form("email"))
Set fso = Server.CreateObject("Scripting.FileSystemObject")
strSQL = "SELECT user FROM users WHERE user='" & usern & "';"
Set RS = conn.Execute(strSQL) 'check if user exists in DB
If Not RS.EOF Then 'user already exists in database
DBuNameExists = True
failed = True
End If
'remove this if you are not using the user manager with FileAce
'If fso.FolderExists(physicalPathToUsers & "\" & usern) Then
' FSuNameExists = True 'folder already exists
'failed = True
End If
' If Not failed Then
' If FileAceExists = "yes" Then
' fso.CreateFolder (physicalPathToUsers & "\" & usern) ' create the root folder
'End If
strSQLUpdate = "INSERT INTO users (user, pass, email, forename, surname)"
strSQLUpdate = strSQLUpdate & " VALUES ('" & Server.HTMLEncode(usern) & "'"
strSQLUpdate = strSQLUpdate & ",'" & Replace(Server.HTMLEncode(pass),"'","'") & "'"
strSQLUpdate = strSQLUpdate & ",'" & Replace(Server.HTMLEncode(email),"'","'") & "'"
strSQLUpdate = strSQLUpdate & ",'" & Replace(Server.HTMLEncode(forename),"'","'") & "'"
strSQLUpdate = strSQLUpdate & ",'" & Replace(Server.HTMLEncode(surname),"'","'") & "');"
conn.Execute(strSQLUpdate) 'enter details into database
isReg = "Yes"
End If
End If
%>
<html>
<head>
<title>Login
</title>
<script language="JavaScript">
document.oncontextmenu = function() {return false};
var regd = "<%= isReg %>";
if (regd == "Yes") {
window.opener.openwin(360, 175, 'login.asp?reg=y', 'no');
window.close();
}
function isValid() {
var illegalChar = '\\,/,:,*,<,>,|,=,(,),$,%,£,^,&,!,?,{,},[,],\',+,¬,\"'; // not an exhaustive list
var arrBad = illegalChar.split(",");
with (document.regfrm) {
for (i=0;i<elements.length;i++) { // loop through form elements and ensure they are not blank
if(elements*.value == "") {
alert("Please complete all fields");
elements*.focus();
return false;
}
}
for(i=0;i<arrBad.length;i++) { // loop through illegal characters and compare to username
if (flder.value.indexOf(arrBad*) != -1) {
alert(arrBad + " is an invalid character for a username. Please try again");
flder.focus();
return false;
}
}
if (pass.value != pass2.value) { // check that passwords match up
alert("The passwords you entered do not match.");
pass.focus();
return false;
}
if (!/^.+@.+\..{2,3}$/.test(email.value)) { // check format of email address for legality
alert("Your email address is incorrectly formatted");
email.focus();
return false;
}
}
return true;
}
</script>
<link rel="stylesheet" href="web-sn_popup.css" type="text/css">
</head>
<body>
<form name="regfrm" action="register.asp?l=y" method="post" onSubmit="return isValid()">
<table border="0" cellspacing="5" cellpadding="4" width="95%" align="center">
<tr>
<td><fieldset><legend>
<% If failed Then
Response.Write("<font color='red'><b>Registration Failed. See Notes Below</b></font>")
Else
Response.Write("Site Manager Registration")
End If
%>
</legend><br>
<table border="0" cellspacing="0" cellpadding="0" width="95%" align="center">
<tr>
<td colspan="2">
<% If FSuNameExists Or DBuNameExists Then
Response.Write("<b>Sorry, username " & user & " is already taken.</b>")
Else
Response.Write("The username you enter will also be the name of your root folder. All fields are required.")
End If
%>
</td>
</tr>
<tr>
<td>
<% If FSuNameExists Or DBuNameExists Then
Response.Write("<font color='red'><b>Username:</b></font>")
Else
Response.Write("Username:")
End If
%>
</td><td><input type="text" size="25" name="flder"></td>
</tr>
<tr>
<td>Password:</td><td><input type="password" size="25" name="pass"></td>
</tr>
<tr>
<td>Confirm Password:</td><td><input type="password" size="25" name="pass2"></td>
</tr>
<tr>
<td>First Name:</td><td><input type="text" size="25" name="forename"></td>
</tr>
<tr>
<td>Surname:</td><td><input type="text" size="25" name="surname"></td>
</tr>
<tr>
<td>Email Address:<br><br></td><td><input type="text" size="25" name="email"><br><br></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="95%" align="center">
<tr>
<td width="100%" colspan="4" align="right">
<input type="submit" value="Ok" class="buttons">
<input type="button" value="Cancel" class="buttons" onClick="window.close()">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
conn.Close
Response.Flush
%>
-------------------------------------------***