才转PHP 为了建立一个个人代码库 100分求程序代码 自己先到google里面搜索一些源码了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /** * 防止sql注入函数 * * @param string $post_data 用户输入数据 */function quotes($post_data){ if (!get_magic_quotes_gpc()) { if (is_array($post_data) && count($post_data)) { foreach ($post_data as $post_key => $post_val) { $post_data[$post_key] = quotes($post_val); } } else { $post_data=addslashes($post_data); } return $post_data; } else { return $post_data; }}/***操作成功提示**@param string $msg 成功信息*@param string $tourl 跳转地址*/function showMsg($msg,$tourl){?><html><head><!-- css --><style type="text/css">.menu { font-family: "Verdana"; font-size: 8pt; font-weight: bold; }.content { font-family: "Verdana"; font-size: 8pt; }.border { border: 1px #000000 dotted; }a:visited { color: #000000; text-decoration: none }a:link { color: #000000; text-decoration: none }a:hover { color: blue; text-decoration: underline }</style><!-- css --><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta HTTP-EQUIV="REFRESH" CONTENT="2;URL=<?php echo "$tourl"; ?>"></head><body><table><tr><td height="150"> </td></tr></table><table cellspacing="0" cellpadding="5" width="450" class="border" align="center"><tr bgcolor="#99CC66"><td height="11" align="left" bgcolor="#E1E4CE" class="menu">操作成功</td></tr><tr><td align="left" class="content"><font color="red"><? echo "$msg"; ?></font> <p align="left"><a href="<? echo "$tourl"; ?>">系统两秒钟后将跳转,如果您不想等待请点击</a></p></td></tr></table></body></html><? exit;}/***操作出错提示函数**/function showError($msg){?><!-- css --><style type="text/css">.menu { font-family: "Verdana"; font-size: 8pt; font-weight: bold; }.content { font-family: "Verdana"; font-size: 8pt; }.border { border: 1px #000000 dotted; }a:visited { color: #000000; text-decoration: none }a:link { color: #000000; text-decoration: none }a:hover { color: blue; text-decoration: underline }</style><!-- css --><meta http-equiv="Content-Type" content="text/html; charset=gb2312""></head><body><table><tr><td height="150"> </td></tr></table><table cellspacing="0" cellpadding="5" width="450" align="center" class="border"><tr bgcolor="#99CC66"><td height="11" align="left" bgcolor="#E1E4CE" class="menu">错误提示:</td></tr><tr><td align="left" class="content"><font color="red"><br><? echo $msg; ?></font><p align="left"><a href="javascript:history.go(-1);">[返回]</a></p></td></tr></table><?exit;} windows server 2003 服务器上安装phpnow合适吗 为什么不用addslashes 或者htmlspecialchars php session和post 缓存,如何防止回退 redhat9下配置完lamp后,在test.php文件的echo "path=$PATH";为啥不显示路径?? 随便看看 全文搜索的问题 新闻系统中 ,什么是摘要新闻 问一个PHP配置方面的问题,知道的透露一下。谢谢。 重赏之下,必有勇夫:文章正文分页的实现方法! 请问 投票 和 评论插件的原理? 关注2038年问题,比千年虫更严重的问题 info.php出现空白页
* 防止sql注入函数
*
* @param string $post_data 用户输入数据
*/
function quotes($post_data)
{
if (!get_magic_quotes_gpc())
{
if (is_array($post_data) && count($post_data))
{
foreach ($post_data as $post_key => $post_val)
{
$post_data[$post_key] = quotes($post_val);
}
}
else
{
$post_data=addslashes($post_data);
}
return $post_data; }
else
{
return $post_data;
}
}/**
*操作成功提示
*
*@param string $msg 成功信息
*@param string $tourl 跳转地址
*/
function showMsg($msg,$tourl){
?>
<html><head>
<!-- css -->
<style type="text/css">
.menu { font-family: "Verdana"; font-size: 8pt; font-weight: bold; }
.content { font-family: "Verdana"; font-size: 8pt; }
.border { border: 1px #000000 dotted; }
a:visited { color: #000000; text-decoration: none }
a:link { color: #000000; text-decoration: none }
a:hover { color: blue; text-decoration: underline }
</style>
<!-- css -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta HTTP-EQUIV="REFRESH" CONTENT="2;URL=<?php echo "$tourl"; ?>">
</head>
<body>
<table>
<tr><td height="150"> </td>
</tr>
</table>
<table cellspacing="0" cellpadding="5" width="450" class="border" align="center">
<tr bgcolor="#99CC66">
<td height="11" align="left" bgcolor="#E1E4CE" class="menu">操作成功</td></tr><tr>
<td align="left" class="content"><font color="red"><? echo "$msg"; ?></font>
<p align="left"><a href="<? echo "$tourl"; ?>">系统两秒钟后将跳转,如果您不想等待请点击</a></p></td></tr>
</table>
</body></html>
<?
exit;
}
/**
*操作出错提示函数
*
*/function showError($msg)
{?>
<!-- css -->
<style type="text/css">
.menu { font-family: "Verdana"; font-size: 8pt; font-weight: bold; }
.content { font-family: "Verdana"; font-size: 8pt; }
.border { border: 1px #000000 dotted; }
a:visited { color: #000000; text-decoration: none }
a:link { color: #000000; text-decoration: none }
a:hover { color: blue; text-decoration: underline }
</style>
<!-- css -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"">
</head>
<body>
<table>
<tr><td height="150"> </td>
</tr>
</table>
<table cellspacing="0" cellpadding="5" width="450" align="center" class="border">
<tr bgcolor="#99CC66">
<td height="11" align="left" bgcolor="#E1E4CE" class="menu">错误提示:</td></tr><tr>
<td align="left" class="content"><font color="red"><br><? echo $msg; ?></font>
<p align="left"><a href="javascript:history.go(-1);">[返回]</a></p></td></tr>
</table>
<?
exit;
}