Flash + asp tutorial submit and save data to text file code
As Code
OK. OK. onRelease = function ()
{
If (x_bt.text! = "" & X_wz.text! = "")
{
Showtime ();
MS = "|" + timer + "" + x_bt.text + "@" + x_wz.text;
Txtload = new LoadVars ();
Txtload. message = MS; er_tx.text = MS;
Txtload. sendAndLoad ("notes/yz_write.asp", txtload, "post ");
Txtload. onData = function (str)
{
If (str = "OK ")
{
_ Parent. main. bt_btn.removeMovieClip ();
_ Parent. main. xian1. _ visible = 0;
_ Parent. main. xian2. _ visible = 0;
_ Parent. alpha_load (_ root. fenye. xie_mc, 0 );
_ Parent. main. bt_txt_load ();
_ Root. fh_btn_wz (1 );
X_bt.text = "";
X_wz.text = "";
Er_tx.text = "submitted successfully! ";
}
Else
{
Er_tx.text = "network connection error. Please refresh. ";
X_bt.text = "";
X_wz.text = "";
} // End else if
};
} // End if
};
Asp save code
<%
Dim FSO, path, text, asp_ms
Set FSO = Server. CreateObject ("Scripting. FileSystemobject ")
Path = Server. MapPath ("pl_read.asp ")
Asp_ms = Request. Form ("message ")
Set text = FSO. CreateTextFile (path, 8)
Text. WriteLine (asp_ms)
Text. close
Set FSO = nothing
Response. Write ("OK ")
%>