PHP:将Flash连接到数据库(远程处理)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP:将Flash连接到数据库(远程处理)相关的知识,希望对你有一定的参考价值。

  1. /* /flashservices/services/Catalog.php */
  2. class Catalog {
  3. var $products_array = array();
  4.  
  5. // Constructor: Contains the list of methods available to the gateway
  6. function Catalog() {
  7. $this->methodTable = array (
  8. "getProducts" => array (
  9. "description" => "Get list of products",
  10. "access" => "remote",
  11. "arguments" => "" // arguments could be optional, not tested
  12. )
  13. ); // end methodTable
  14. }
  15.  
  16. function getProducts() {
  17. // your code goes here
  18.  
  19. return $this->products_array;
  20. }
  21. }
  22.  
  23.  
  24. #include "NetServices.as"
  25. NetServices.setDefaultGatewayUrl("http://yourserver.com/flashservices/gateway.php");
  26. gw = NetServices.createGatewayConnection();
  27. CatalogREMOTE = gw.getService("Catalog", this);
  28. CatalogREMOTE.getProducts();
  29.  
  30. getProducts_Result = function(result) {
  31. _root.products_results = result;
  32. }

以上是关于PHP:将Flash连接到数据库(远程处理)的主要内容,如果未能解决你的问题,请参考以下文章