php 替换非法字符 保存到数据库
function _processBeforeDb($str)
{
$str = str_replace ( array ('<', '>' ), array ('<' , '>' ), $str );
if (!get_magic_quotes_runtime()){
return addslashes($str);
}
else
{
return $str;
}
}
相关文档:
本文首发代码天下,转载请注明来源代码天下,谢谢。
今天上班时遇到一个问题,游戏官反应一个用户充不了值。充不了值一般为用户角色不正确,我仔细检查发现该用户角色有点异常,因为对方返回角色是xml,我贴上来给大家看一下:
<Result value="true" message="Success!"> <It ......
<?php
function myFun(){
echo "hello,张三";
}
//利用function_exists方法判断自动以方法是否存在
//该方法参数为要判断的自定义方法的方法名,可写为
//"myFun"或myFun
if(function_exists(myFun)){
echo "存在 ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<meta http-equiv="Content-Type" content="text/html; ......
使用过SQL Server的人应该都清楚,SQL Server常用的有两种认证方式,一种是本地系统账户认证(Windows Authentication ),一种是使用用户名和密码(SQL Server Authentication ),第二种认证方式必须启用SQL Server的混合模式。
1.Windows Authentication连接部分代码段:
<?php
$serverName = "(local)";
$co ......