flash用php连接数据库的代码

yipeiwu_com6年前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判断变量是否为0的方法

复制代码 代码如下: <? if($_POST['some'] != null) { //It's Not Empty } ?>...

一键生成各种尺寸Icon的php脚本(实例)

实例如下: <?php /** * @name thumb 缩略图函数 * @param sting $img_name 图片路径 * @param...

PHP开启opcache提升代码性能

配置指令如下: [opcache] zend_extension=opcache.so opcache.enable_cli=1 ;共享内存大小, 这个根据你们的需求可调 opcac...

php中fsockopen用法实例

本文实例讲述了php中fsockopen用法。分享给大家供大家参考。 具体实现方法如下: 复制代码 代码如下:$fp=fsockopen("127.0.0.1",80); &n...

php读取mssql的ntext字段返回值为空的解决方法

本文实例讲述了php读取mssql的ntext字段返回值为空的解决方法。分享给大家供大家参考。具体分析如下: 今天在使用php连接mssql数据库时发现ntext字段的内容无法显示,经过...