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 巧用数组降低程序的时间复杂度

关于作者 王丹丹 , IBM 中国系统与技术中心软件工程师,自从 2006 年加入 IBM,一直从事 Web 系统设计和开发工作,有五年 PHP 应用程序设计开发经验。 通常开发人员在写...

PHP生成月历代码

<?php /*   Function Written by Nelson Neoh @3/2004.&nbs...

php 连接mssql数据库 初学php笔记

复制代码 代码如下: <?php $serverSite="."; $db="phpdemo"; $name="sa"; $pass="sa"; $conn=@mssql_conn...

php中Socket创建与监听实现方法

本文实例讲述了php中Socket创建与监听实现方法。分享给大家供大家参考。具体如下: 这里提供了在php中socket相关函数的一个实例,如创建Socket,接受一个socket连接...

php文章内容分页并生成相应的htm静态页面代码

复制代码 代码如下: <?php $url='test.php?1=1'; $contents="fjka;fjsa;#page#批量生成分成文件并且加上分页代码"; $ptext...