Flash and asp:
First put two code:
Flash
var loader:urlloader = new Urlloader ();
var url:http://www.111cn.net/flash_a/114/urlrequest = new Http://www.111cn.net/flash_a/114/URLRequest ("test.asp");
Url.method = Http://www.111cn.net/flash_a/114/URLRequestMethod.POST;
var values:urlvariables = new Urlvariables ();
values.message= "Hello im flash!";
Url.data = values;
Loader.dataformat = Urlloaderdataformat.variables;
Loader.addeventlistener (event.complete,loaded);
function loaded (e:event) {
Out1.text=loader.data;
Output:phpmessage=im php Message!&flashmessage=hello im flash!
Out2.text=loader.data.phpmessage;
im PHP message!
Out3.text=loader.data.flashmessage;
Hello im flash!
Out4.text=loader.data.dbmessage;
}
Loader.load (URL);
Asp:
<% @LANGUAGE = "JAVASCRIPT"%>
<%
Receive the data that flash passes in
var flashdata;
Flashdata = Request ("message");
Data sent to Flash
var aspmessage;
Aspmessage = ' im asp message! ';
Database-related Operations
//======================================
var Conn;
var rs;
var sql;
var strpath;
Strpath= "Test.mdb";
try{
conn = Server.CreateObject ("ADODB"). Connection ");
conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Server.MapPath (StrPath);
Conn.Open ();
}catch (e) {
Response.Write (' <meta http-equiv= "Content-type" content= "text/html; charset=utf-8"/><div style= "font-size : 12px;font-weight:bold;border:1px solid #006;p adding:6px;background: #fcc > Database connection error, please check the connection string!</div> ');
Response.End
}
Rs=server.createobject ("ADODB.") Recordset ");
Sql= "SELECT * from name";
Rs.Open (sql,conn,1,1);
//======================================
Response.Write ("phpmessage=" +aspmessage+ "&" + "flashmessage=" +flashdata+ "&" + "dbmessage=" +rs ("CompanyName "));
%>
See the Flash and ASP files when the face variable name to know how each other is transmitted, for some of the database inserts, updates, query operations, as long as the receipt of flash data, directly run the ASP-related database Operations command on the line. You can test it by copying it directly to the path of IIS. View Online Address: