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 页面跳转到另一个页面的多种方法方法总结

一、用HTTP头信息 也就是用PHP的HEADER函数。PHP里的HEADER函数的作用就是向浏览器发出由HTTP协议规定的本来应该通过WEB服务器的控制指令,例如声明返回信息的类型("...

解析PHP无限级分类方法及代码

解析PHP无限级分类方法及代码

无论你要构建自己的论坛,在你的网站上发布消息还是书写自己的CMS程序,你都会遇到要在数据库中存储层次数据的情况。同时,除非你使用一种像XML的数据库,否则关系数据库中的表都不是层次结构的...

php生成静态文件的多种方法分享

第一种:将php动态页面内容生成静态复制代码 代码如下: ob_start();#开启服务器缓存 include_once 'Index.php'; $ctx=ob_get_conten...

php文本转图片自动换行的方法

今天无意中浏览网面的时候发现一个长微博,它可以将文本转成png图片,于是乎就研究一下PHP文本转图片的方式,其实只要是用到了PHP的扩展库,GD库来生成图片,再通过图像函数生成,代码写出...

基于pear auth实现登录验证

建立一个名为yz.php的页面 复制代码 代码如下: <?php require_once('Auth.php'); function show_login_form () { e...