Hjælp!
HejJeg har et auktions forum! Men når man skal sende et password efter man er registret!
men så kommer der:
Oprettelse fik succes! - Det er også godt nok men nede under for jeg denne bedsked:
Microsoft VBScript runtime error \'800a0046\'
Permission denied
/nss/Auktion/postuser.asp, line 126
Og der for du koden altså den hvor det skulle være galt:
<!-- #include file=\"auctionlib.asp\" -->
<%
sUserName = Request.Form(\"username\")
sName = Request.Form(\"name\")
sEmail = Request.Form(\"email\")
sAddressOne = Request.Form(\"addressone\")
sAddressTwo = Request.Form(\"addresstwo\")
sCity = Request.Form(\"city\")
sState = Request.Form(\"state\")
sZip = Request.Form(\"zip\")
Call OpenDBConn
Call DoPageHeader
Response.Write(\"<FONT FACE=\" & chr(34) & sFont & chr(34) & \">\")
If Len(Trim(sUserName)) = 0 Then
sString = sString & \"There is something wrong with the \"\"USER NAME\"\" field.<BR>\"
End If
If Len(Trim(sName)) = 0 Then
sString = sString & \"There is something wrong with the \"\"NAME\"\" field.<BR>\"
End If
If Len(Trim(sEmail)) = 0 Then
sString = sString & \"There is something wrong with the \"\"EMAIL\"\" field.<BR>\"
End If
If Len(Trim(sAddressOne)) = 0 Then
sString = sString & \"There is something wrong with the \"\"Address 1\"\" field.<BR>\"
End If
If Len(Trim(sCity)) = 0 Then
sString = sString & \"There is something wrong with the \"\"CITY\"\" field.<BR>\"
End If
If sState = \"other\" Then
sString = sString & \"There is something wrong with the \"\"STATE\"\" field.<BR>\"
End If
If Len(Trim(sZip)) = 0 Then
sString = sString & \"There is something wrong with the \"\"Zip Code\"\" field.<BR>\"
End If
If sString <> \"\" Then
Response.Write (\"<CENTER>\" & sString & \"Please click the \"\"BACK\"\" button on your browser to try again.</CENTER>\")
Else
Call CheckName
End If
Call DoPageFooter
Sub CheckName
sSQl = \"\"
sSQL = sSQL & \"SELECT COUNT(*) as Total FROM registration WHERE username = \" & SQLStr(sUserName)
Set CountRS = GobjConnect.Execute(sSQL)
If CountRS.Fields(\"Total\") > 0 Then
Response.Write(\"<CENTER>The User Name you chose,\" & chr(34) & \"<B>\" & sUserName & \"</B>\" & chr(34) & \", has already been taken.<BR>\")
Response.Write(\"Please use the \"\"<B>BACK</B>\"\" button on your browser to try again.</CENTER>\")
Else
Call InsertUser
End If
End Sub
Sub InsertUser
Randomize
sPassword = clng(rnd * 1000000) + 1000
npSQL = \"\"
npSQL = npSQL & \" INSERT INTO Registration (username, password, Validated, Name, Email, Address1, Address2, City, State, Zip) \"
npSQL = npSQL & \" VALUES (\" & SQLStr(sUserName) & \", \"
npSQL = npSQL & SQLStr(sPassword) & \" , \"
If bUsersAdd = False Then
npSQL = npSQL & \" false , \"
Else
npSQL = npSQL & \" true , \"
End If
npSQL = npSQL & SQLStr(sName) & \", \"
npSQL = npSQL & SQLStr(sEmail) & \", \"
npSQL = npSQL & SQLStr(sAddressOne) & \", \"
npSQL = npSQL & SQLStr(sAddressTwo) & \", \"
npSQL = npSQL & SQLStr(sCity) & \", \"
npSQL = npSQL & SQLStr(sState) & \", \"
npSQL = npSQL & SQLStr(sZip) & \" )\"
GobjConnect.Execute(npSQL)
Response.Write(\"<CENTER>Your registration has been completed successfully.<BR>\")
Call SendPassEmail(sPassword)
Response.Write(\"Your password has been emailed to you.<BR>\")
Response.Write(\"You can change your password by clicking on the \"\"Change Password\"\" link on the home page.<BR>\")
Response.Write(\"<A HREF=\"\"default.asp\"\">Click here</A> to continue.</CENTER>\")
End Sub
Sub SendPassEmail(sPass)
sBody = \"\"
sBody = sBody & chr(10) & chr(13)
sBody = sBody & \"Autoresponder: DO NOT REPLY TO THIS EMAIL\" & chr(10) & chr(13)
sBody = sBody & \"Thank you for registering with XcAuction!\" & chr(10) & chr(13)
sBody = sBody & \"This is the demo version of XcAuction. If you have any suggestions or comments, let us know! \"
sBody = sBody & \"XcAuction Lite will be released very shortly, and best of all, will be 100% FREE. \"
sBody = sBody & \"XcAuction is a terrific way to build repeat visitors to your website, and a great place for you to sell your own items. \"
sBody = sBody & \"XcAuction Lite will be released very shortly, and best of all, will be 100% FREE. \"
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & \"***** SAVE THIS EMAIL -- DO NOT LOSE YOUR PASSWORD! *****\" & chr(10) & chr(13)
sBody = sBody & \" Your user name is: \" & sUserName & chr(10) & chr(13)
sBody = sBody & \" Your password is : \" & sPass & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & chr(10) & chr(13)
sBody = sBody & \"You can change your password at any time by going to: \" & sAuctPath & \"changepassword.asp\"
sBody = sBody & chr(10) & chr(13)
sBody = sBody & \"Thank you for using XcAuction Lite! Please visit again. \" & sAuctPath
sBody = sBody & chr(10) & chr(13)
sBody = sBody & \"Powered by XCENT http://www.xcent.com\"
Set objCDO = Server.CreateObject(\"CDONTS.NewMail\")
objCDO.To = sEmail
objCDO.From = sAuctionEmail
objCDO.Subject = \"Your Auction Password!\"
objCDO.Body = sBody <- linie 126
objCDO.Send
End Sub
%>
