flash用php连接数据库的代码

yipeiwu_com5年前PHP代码库
php代码:
复制代码 代码如下:

/* /flashservices/services/Catalog.php */
class Catalog {
        var $products_array = array();

// Constructor: Contains the list of methods available to the gateway
function Catalog() {
        $this->methodTable = array (
                "getProducts" => array (
                        "description" => "Get list of products",
                        "access" => "remote",
                        "arguments" => "" // arguments could be optional, not tested
                )
        ); // end methodTable
}

function getProducts() {       
        // your code goes here

        return $this->products_array;
}
}

actionscript代码:
复制代码 代码如下:

#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://yourserver.com/flashservices/gateway.php");
gw = NetServices.createGatewayConnection();
CatalogREMOTE = gw.getService("Catalog", this);
CatalogREMOTE.getProducts();

getProducts_Result = function(result) {
        _root.products_results = result;

相关文章

php实现的XML操作(读取)封装类完整实例

本文实例讲述了php实现的XML操作(读取)封装类。分享给大家供大家参考,具体如下: <?xml version="1.0" encoding="utf-8" stan...

PHP使用数组实现队列

PHP中将数组当做一个栈,主要是使用array_push()和array_pop()两个系统函数来完成。入栈主要是利用array_push()函数向第一个参数的数组尾部添加一个或多个元素...

PHP中source #N问题的解决方法

最近写PHP里面的查询经常会遇到source #4或者source#5这样的问题,也就是通过mysql_query($sql1)进行一段查询的操作,返回的结果不是想要的字段而是sourc...

PHP 错误之引号中使用变量

当看到错误提示 syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE...

php中$_SERVER[PHP_SELF] 和 $_SERVER[SCRIPT_NAME]之间的区别

“PHP_SELF” 当前正在执行脚本的文件名,与 document root 相关。举例来说,在 URL 地址为 //www.jb51.net/test.php/foo.bar 的脚本...