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扩展开发入门demo示例

本文实例讲述了php扩展开发。分享给大家供大家参考,具体如下: 一、进入php源码包,找到ext文件夹 cd /owndata/software/php-5.4.13/ext...

PHP遍历目录函数opendir()、readdir()、closedir()、rewinddir()总结

在进行PHP编程时,需要对服务器某个目录下面的文件进行浏览,通常成为遍历目录。取得一个目录下的文件和子目录,就需要用到opendir()函数、readdir()函数、closedir()...

php实现将上传word文件转为html的方法

本文实例讲述了php实现将上传word文件转为html的方法。分享给大家供大家参考。具体实现方法如下: 上传页面: <!DOCTYPE html PUBLIC "-//W3C/...

php基础知识:控制结构

php的控制结构,大部分和其他主流语言,如C,Java等相同。 这里列出一些不同的以及经常被考到的细节: 1>流程控制的替代语法(pascal的风格) 主要用在if,while,f...

PHP提取数据库内容中的图片地址并循环输出

复制代码 代码如下: /* 1 (?s) 代表 Pattern.DOTALL,也就是匹配换行,允许 img里出现在多行 2 .*?代表非贪婪匹配任意字符,直到后面的条件出现 3 ?: 代...