Forums

ASP

This topic is locked

Getting error, need help!

Posted 17 years ago
1
has voted
17 years ago mike lafferty posted:
here is the code:

<%
sub gameson(num1)

Dim filename, fs, f
filename = "flag.txt"
Set fs=Server.CreateObject("Scripting.FileSystemObject"
set f=fs.OpenTextFile("flag.txt", 2, True)
f.write("num1"
f.close
Set f=nothing
Set fs=nothing
Response.Write("Games Are Set To On!"

end sub
%>

here is how im trying to call the sub

<FORM>
<TABLE BORDER CELLPADDING=3>
<TR>
<TD><INPUT TYPE=BUTTON OnClick=<%call gameson(1)%> VALUE="Games On!"></TD>
</TR>
</TABLE>
</FORM>

this is the error im getting

Microsoft VBScript runtime error '800a0046'

Permission denied

/flagpage.asp, line 14

after i upload it and try to view the page that is what happens, can anyone help me??

Replies

Replied 17 years ago
17 years ago Prabhjot Kang replied:
Hi Mike
this could be due to the permissions granted at the server folder.
You must have read write (chmod as 777) for the folder you are trying to write file in.
Replied 17 years ago
17 years ago mike lafferty replied:
thanks! ok i got the permissions set, and that seems to be working, but how do I get a button to call a sub routine??
i've been trying to figure it out for almost a week now and i've got nothing.
any help is appreciated
Thanks in advance!!

Reply to this topic