Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Sorre webforumsuser@macromedia.com #1
Save data on server with asp script
Hi all !
I did al lot of reading over the last few days and so far I'm still not as fasr as I want to :)
I have my director script for my submit button:
on mouseUp me
thePath = "/cgi-local/hscoredata/"
theFile = "highscore.txt"
myString = "test"
theMode = 2
netID = postNetText ("http://www.pizzaplace.de/cgi-local/hscore.asp",["path":thePath,"filename":theFile,"filestring":myS tring,"mode":theMode])
go "Result"
end
and here is the asp script (can anyone tell me whats wrong... please ;( )
<%@ LANGUAGE = "VBScript" %>
<%
On Error Resume Next
' Constants for FileSystemObject
Const ForReading = 1, ForWriting = 2, ForAppending = 8
'Form Variables
Dim fPath, fName, fString, fMode
fPath = Request.Form("path")
fName = Request.Form("filename")
fString = Request.Form("filestring")
fMode = Request.Form("mode")
'Test form variables
If fPath = "" Then
Response.Write "File path name is not specified"
Response.End
End If
If fName = "" Then
Response.Write "File name is not specified"
Response.End
End If
If fMode = "" Then
fMode = 8
Else
fMode = CInt(fMode)
End If
'Start processing
' Lock the application
Application.Lock
' Create a file system object and open the count file for reading
Set Fs = CreateObject ("Scripting.FileSystemObject")
'Check folder exists
If Not Fs.FolderExists(Server.MapPath(fPath)) Then
Fs.CreateFolder(Server.MapPath(fPath))
End If
'Check file exists
If Not Fs.FileExists(Server.MapPath(fPath & fName)) Then
Fs.CreateTextFile(Server.MapPath(fPath & fName))
End If
'map the path
sPath = Server.MapPath(fPath & fName)
' Open the file
Set theFile = Fs.OpenTextFile(sPath, fMode)
'Check the mode
If fMode = 1 Then
'opened as read only
Response.Write theFile.ReadAll()
Else
' Write the string to the file
theFile.Writeline(fString)
' Close the counter file
theFile.Close
Response.Write "Done"
End If
' Unlock the application object
Application.Unlock
' Release File system object and file
Set Fs = Nothing
Set theFile = Nothing
%>
It's not really doing anything, but I think it looks right... >( could the path be wrong ? can someone explain a relative path ?
I set the script on chmod 755 and the textfile to 666 is that right ? The server handles different php and pl scripts I really think its supports asp too....
Help :)
Thank You
Daniel
Sorre webforumsuser@macromedia.com Guest
-
6.1 script not working on 7.0 server. Script used towork!
I've a problem with some coldfusion 6.1 scripts running on a server with coldfusion 7. It seems that it isn't accepting the hidden type for the tag... -
Save script error text?
Hi, i just wondererd, when I receive an alert when I test a movie in Director, is it possible to retrieve the text of that alert? For example,... -
ITC - urgent!!!I'd like to transmit binary data from SQL server to client and load it into variable. I used for this Microsoft Internet Transfer Control and my script looks like this:
I'd like to transmit binary data from SQL server to client and load it into variable. I used for this Microsoft Internet Transfer Control and my... -
Save data to server without postback?
I have an intranet application where some pages display large tables of editable data. I've designed the page to operate like Microsoft Access... -
Run filemaker script on sql server data?
Hi is it possible to take a sql database, run a filemaker script on the data, and then have it update the sql server data? I'm new at this so... -
Andrew Morton #2
Re: Save data on server with asp script
To test your CGI script, make an ordinary html <form> and use use it in a
browser.
And I don't think you want "on error resume next" because you want to see every
error whilst testing.
Andrew
Andrew Morton Guest



Reply With Quote

