flex 和php 通信
php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>flex login</title>
</head>
<body>
<?php
$return="";
if(isset($_POST[username]) && isset($_POST[userpwd])){
if ("User"==$_POST[username] && "123456"==$_POST[userpwd])
$return="ok";
else
$return="error";
}
$xml_return = '<users>';
$xml_return.= '<a>'.$return.'</a>';
$xml_return.= '</users>';
echo $xml_return;
?>
</body>
</html>
Flex:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
private function goLogin():void
{
login.send();
}
private function resultHandler(event:ResultEvent):void
{
Alert.show(event.result.html.body.users.a.toString());
}
]]>
</mx:Script>
<mx:HTTPService id="login"
method="POST"
showBusyCursor="true"
url="http
相关文档:
问题描述:
从php界面insert数据到mysql,只能输入偶数个汉字不能输入奇数个汉字,输入奇数个汉字后报“Data too long for column ”错误,并没有更改数据库数据。到数据库查看,发现汉字都是乱码。但是php界面显示汉字正常(当然显示的都是偶数个汉字,奇数个汉字都没有写入数据库)。
解决思路:
1.更改my.i ......
本文需要你已对Gearman有个大致了解,如果不知该东东是何物,请参考之前一篇转帖日志《Gearman - 分布式远程过程处理框架》
顺便再推荐两篇参考文章
http://hi.baidu.com/thinkinginlamp/blog/item/ff49972b9e7378f3e6cd40aa.html
(学学Gearman)
http://www.ibm.com/developerworks/cn/opensource/os-php-gearman/ind ......
Memcache函数库是在 PECL(PHP Extension Community Library)中,主要作用是搭建大容量的内存数据的临时存放区域,在分布式的时候作用体现的非常明显,否则不建议使用。
Memcache Win32 的安装和PHP中的配置
下载:Memcache Win32
www.php100.com www.jehiah.cz/projects/memcached-win32/
1、解压到目录: ......
原文链接:http://www.phpdo.net/index.php/2010/02/09/1-12/
PHP的数据类型的转换有两种方法可以办到:直接输入目标的数据类型和通过settype函数实现。
PHP数据转换成整数
Float型数据转换成int型
Float型转换成int型,小数点后的数将被舍弃。如果float数超贵超过了整型的取值范围,那么结果可能是0或者是整形的最小负 ......
1.不转意html entities
一个基本的常识:所有不可信任的输入(特别是用户从form中提交的数据) ,输出之前都要转意。
echo $_GET['usename'] ;
这个例子有可能输出:
<scrīpt>/*更改admin密码的脚本或设置cookie的脚本*/</scrīpt>
这是一个明显的安全隐患,除非你保证你的用户都正确的输入。
......