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;

相关文章

smarty实现多级分类的方法

smarty实现多级分类的方法

本文实例讲述了smarty实现多级分类的方法。分享给大家供大家参考。具体分析如下: 这里简单的介绍一下利用php smarty 多级分类读出与循环方法,单循环很简单,但是多级就要复杂一点...

如何写php守护进程(Daemon)

守护进程(Daemon)是运行在后台的一种特殊进程。它独立于控制终端并且周期性地执行某种任务或等待处理某些发生的事件。守护进程是一种很有用的进程。php也可以实现守护进程的功能。 一、基...

php将字符串全部转换成大写或者小写的方法

本文实例讲述了php将字符串全部转换成大写或者小写的方法。分享给大家供大家参考。具体分析如下: php中可以通过strtolower和strtoupper两个函数将字符串中的每个英文字符...

5种PHP创建数组的实例代码分享

看这篇文章之前相信大家都已经看过PHP中文手册关于数组这一节的讲解了,怎么样呢,看懂了多少?至少我第一次阅读文档时是一头雾水,也许是因为在翻译的不够通俗易懂吧^_^!!这里UncleTo...

php PDO中文乱码解决办法

// 方法一: PDO::__construct($dsn, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NA...