PCLWebster
Technical User
I'm just starting out with ASP and I am having loads of probs getting to write a file. I get an Error on the line containing Set file = fso.opentextfile(path,3,TRUE
I dunno why.. Maybe its because I havent been given a FULL path by my ISP. All they have given me is a folder called _Private which has read/write permissions.
Can any one help??? Please
<%
Dim name1,name2,email,company,address1,address2,address3,address4,username,password,password2,status
Dim strName,strUsername,strPassword,strCurrentStatus,path
Dim objCDO
path="/_private/pcl-user.txt"
sender=Request.Form("email"
first_name=Request.Form("name1"
last_name=Request.Form("name2"
company=Request.Form("company"
add1=Request.Form("address1"
add2=Request.Form("address2"
add3=Request.Form("address3"
add4=Request.Form("address4"
username=Request.Form("username"
password=Request.Form("password"
validate=Request.Form("password2"
status=Request.Form("status"
Set objCDO=Server.CreateObject("CDONTS.NewMail"
' Variables for Read/Write > > > > > > > > > > > > > > > >
strName=Request.Form("name1" & Request.Form("name2"
strUsername=Request.Form("username"
strPassword=Request.Form("password"
strCurrentStatus="Guest"
Set fso=Server.CreateObject("Scripting.FileSystemObject"
set file=fso.opentextfile(path,3,TRUE)
file.write(strName) & vbcrlf
file.write(strUsername) & vbcrlf
file.write(strPassword) & vbcrlf
file.write(strCurrentStatus) & vbcrlf & vbcrlf
file.close
set file = nothing
set fso = nothing
' > > > > > > > > > > > > > > > > > > >
objCDO.From=sender
objCDO.To="webmaster@priory-campus.co.uk"
objCDO.Subject="HLC Registration"
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
HTML="<html>"
HTML=HTML & "<head>"
HTML=HTML & "</head>"
HTML=HTML & "<body>"
HTML=HTML & first_name & " " & last_name & " from "& company &" has completed the regitration form." & "<BR>"
HTML=HTML & "Details are; <BR>"
HTML=HTML & "Username: " & username & "<BR>"
HTML=HTML & "Password: " & password & "<BR>"
HTML=HTML & "<b>Company :</b>" & "<BR>"
HTML=HTML & " " & company & "<BR>"
HTML=HTML & "<b>Address :</b>" & "<BR>"
HTML=HTML & " " & add1 & "<BR>"
HTML=HTML & " " & add2 & "<BR>"
HTML=HTML & " " & add3 & "<BR>"
HTML=HTML & " " & add4 & "<BR>"
HTML=HTML & "The user has requested " & status & " Status" & "<BR>"
HTML=HTML & "</body>"
HTML=HTML & "</html>"
objCDO.body=HTML
objCDO.Send
%>
<%
Response.Write("Thank You." & " Your current User Status is '"& current_status &"'"
%>
I dunno why.. Maybe its because I havent been given a FULL path by my ISP. All they have given me is a folder called _Private which has read/write permissions.
Can any one help??? Please
<%
Dim name1,name2,email,company,address1,address2,address3,address4,username,password,password2,status
Dim strName,strUsername,strPassword,strCurrentStatus,path
Dim objCDO
path="/_private/pcl-user.txt"
sender=Request.Form("email"
first_name=Request.Form("name1"
last_name=Request.Form("name2"
company=Request.Form("company"
add1=Request.Form("address1"
add2=Request.Form("address2"
add3=Request.Form("address3"
add4=Request.Form("address4"
username=Request.Form("username"
password=Request.Form("password"
validate=Request.Form("password2"
status=Request.Form("status"
Set objCDO=Server.CreateObject("CDONTS.NewMail"
' Variables for Read/Write > > > > > > > > > > > > > > > >
strName=Request.Form("name1" & Request.Form("name2"
strUsername=Request.Form("username"
strPassword=Request.Form("password"
strCurrentStatus="Guest"
Set fso=Server.CreateObject("Scripting.FileSystemObject"
set file=fso.opentextfile(path,3,TRUE)
file.write(strName) & vbcrlf
file.write(strUsername) & vbcrlf
file.write(strPassword) & vbcrlf
file.write(strCurrentStatus) & vbcrlf & vbcrlf
file.close
set file = nothing
set fso = nothing
' > > > > > > > > > > > > > > > > > > >
objCDO.From=sender
objCDO.To="webmaster@priory-campus.co.uk"
objCDO.Subject="HLC Registration"
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
HTML="<html>"
HTML=HTML & "<head>"
HTML=HTML & "</head>"
HTML=HTML & "<body>"
HTML=HTML & first_name & " " & last_name & " from "& company &" has completed the regitration form." & "<BR>"
HTML=HTML & "Details are; <BR>"
HTML=HTML & "Username: " & username & "<BR>"
HTML=HTML & "Password: " & password & "<BR>"
HTML=HTML & "<b>Company :</b>" & "<BR>"
HTML=HTML & " " & company & "<BR>"
HTML=HTML & "<b>Address :</b>" & "<BR>"
HTML=HTML & " " & add1 & "<BR>"
HTML=HTML & " " & add2 & "<BR>"
HTML=HTML & " " & add3 & "<BR>"
HTML=HTML & " " & add4 & "<BR>"
HTML=HTML & "The user has requested " & status & " Status" & "<BR>"
HTML=HTML & "</body>"
HTML=HTML & "</html>"
objCDO.body=HTML
objCDO.Send
%>
<%
Response.Write("Thank You." & " Your current User Status is '"& current_status &"'"
%>