<?php
function goURL($url='', $msg='')
{
$url = ($url)?$url:$_SERVER['HTTP_REFERER'];
$url = ($url)?$url:'/';
$JSstr = '';
if($msg)
{
$JSstr .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
$JSstr .= "<script>alert('$msg');</script>\n";
}
$JSstr .= "<script>location.href='$url'</script>\n";
$JSstr .= "<meta http-equiv=\"refresh\" content=\"1; url=$url\">";
echo $JSstr;
exit();
}
function html_options($arr, $set='AaBa005353dffs')
{
foreach($arr as $k=>$v)
{
if(is_array($v))
{
$options[] = "<optgroup title='$k'>";
foreach($v as $k2=>$v2)
{
$selected = ($set == $k)?'selected':'';
if(is_array($set))$selected = (in_array($k, $set))?'selected':'';
$options[] = "<option value='$k2' $selected>$v2</option>";
}
$options[] = "</optgroup>";
}
else
{
$selected = ($set == $k)?'selected':'';
if(is_array($set))$selected = (in_array($k, $set))?'selected':'';
$options[] = "<option value='$k' $selected>$v</option>";
}
}
return implode("\n", $options);
}
function html_select($idname='select', $options='', $set='AaBa00fte6t5', $js='', $size=0)
{
$size = ($size==0)?'':"size='$size'";
$select = "<select name='$idname' id='$idname' $size $js style='font-size:12px;'>\n";
if(is_array($options))$select .= html_options($options, $set);
$select .= "</select>\n";
return $select;
}
function html_radios($name, $array, $selected="", $sepreator=" ")
{
$html = "";
foreach($array as $k => $v)
{
$checked = "";
if($k == $selected)$checked = "checked";
$html .= "<label><input name=\"$name\" type=\"radio\" value=\"$k\" $checked> $v</label> $sepreator \n";
}
return $html;
}
function html_checkboxes($name, $array, $selected=array(), $sepreator=" ")
{
$html = "";
foreach($array as $k => $v)
{
$checked = "";
for($i=0;$i<count($selected);$i++)
{
if($selected[$i] == $k)$checked = "checked";
}
$html .= "<label><input name=\"$name\" type=\"checkbox\" value=\"$k\" $checked> $v</label> $sepreator \n";
}
return $html;
}
function NoCacheHeaders()
{
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
}
function moduleCheck()
{
global $conf;
$uri = explode('/', $_SERVER['QUERY_STRING']);
$module = ($_GET['module'])?$_GET['module']:$uri[0];
if(!is_file(ROOT_PATH."/modules/$module.php") && !is_file(ROOT_PATH."/modules/$module/$module.php"))$module = $conf['default_module'];
if(is_file(ROOT_PATH."/modules/$module/$module.php"))$module="$module/$module";
return $module;
}
function submoduleCheck()
{
$uri = explode('/', $_SERVER['QUERY_STRING']);
$module = ($_GET['module'])?$_GET['module']:$uri[0];
$sub = ($_GET['sub'])?$_GET['sub']:$uri[1];
if(is_file(ROOT_PATH."/modules/$module/$sub.php"))return $sub;
}
function URLRewrite()
{
global $conf;
$get = $_GET;
$module = $get['module'];
$sub = $get['sub'];
unset($get['module']);
unset($get['sub']);
$uri = $conf['site_url']."/?$module/$sub".implode('/', $get);
return $uri;
}
function module($module)
{
global $conf;
$module = strtolower($module);
$module_file = ROOT_PATH."/modules/$module.php";
if(file_exists($module_file))return $module_file;
else return ROOT_PATH."/modules/$conf[default_module].php";
}
function scookie($name, $value='', $time=null)
{
global $conf;
return setcookie($name, $value, $time, $conf['cookie_path'], $conf['cookie_host']);
}
function extfunc($func)
{
global $conf;
$path = ROOT_PATH.'/'.$conf['extend_path']."/functions.$func.php";
if(is_file($path))return $path;
else echo "Function $func not found!";
}
function extclass($func)
{
global $conf;
$path = ROOT_PATH.'/'.$conf['extend_path']."/class.$func.php";
if(is_file($path))return $path;
else echo "Class $func not found!";
}
function showphoto($photo,$wh,$nopic='',$class='')
{
$class=empty($class)?'':'class="'.$class.'"';
$nopic=empty($nopic)?'':'<img src="'.$nopic.'" '.$class.' width="'.$wh.'" BORDER="0">';
if(!file_exists($photo)){
return $nopic;
}
$i=$photo;
$s=getimagesize($i);
if($s[0]<=$wh && $s[1]<=$wh){
$bs="";
}else{
if($s[0]>=$s[1]){
$bs=" width='".$wh."' ";
}else{
$bs=" height='".$wh."' ";
}
}
return '<IMG SRC="'.$i.'" '.$bs.' BORDER="0" '.$class.'>';
}
function wordShift($content)
{//过滤敏感词
$s= "*";
$word=array('六四事件','迷昏药','窃听器','买卖枪支','退党','六合彩','k粉');
foreach($word as $keys)
{
$content=eregi_replace($keys,$s,$content);
}
return $content;
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
php+ajax+mysql聊天室源码
共9个文件
php:7个
js:1个
css:1个
4星 · 超过85%的资源 需积分: 9 70 下载量 162 浏览量
2011-09-07
11:24:54
上传
评论 1
收藏 24KB ZIP 举报
温馨提示
php+ajax+mysql聊天室源码php+ajax+mysql聊天室源码
资源推荐
资源详情
资源评论
收起资源包目录
php+ajax+mysql聊天修改后源码.zip (9个子文件)
css
global.css 1KB
index.php 2KB
config.php 541B
include
session.class.php 2KB
db.class.php 1KB
functions.inc.php 5KB
js
jquery.js 54KB
ajax.php 902B
chat.php 1KB
共 9 条
- 1
资源评论
- zzy92sx2012-12-14能使用的 代码还是比较规范 虽然不能直接使用 但是能给开发者提供很好的思路
- 奈竞2014-08-26不能用啊.有问题,亲
- 戍土2014-09-27真不能用啊 _(:з」∠)_
- suyunkai2012-05-01MS不能用啊。。。
- jinqilin19822019-10-13什么啊?根本 没法用,部署了也跑不起来
罪灬的
- 粉丝: 0
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功