• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

xajax写的留言本_php实例

php 搞代码 3年前 (2022-01-25) 22次浏览 已收录 0个评论

session_start();
require_once(“../conn/mysqlconn.php”);
require_once(‘xajax.inc.php’);
if(!isset($_SESSION[‘wid’]))
{
$_SESSION[‘wid’]=$_GET[“wid”];
}
if(isset($_POST[‘content_4’]))
{
$con = new createdb;
$con->createconn();
$con->mysql=”insert into content(webid,tallname,txtconntent) values(‘$_SESSION[wid]’,’$_POST[tallnane]’,’$_POST[content_4]’)”;
$con->getresule();
}
@define(mun_2,3); //定义每页显示几条记
function tt($form_mm)
{
if($_SESSION[“code”]==$form_mm[‘chetxt’]) //用xajax来取得验证码,不同以前的那种看验证码对不对
{
$erro_msg=”谢谢你的支持”;
$jjs=””;
}
else
{
$erro_msg=”验证码不对,请重新在写”;
$jjs=”true”;
}
$obj= new xajaxResponse();
$obj->addAssign(“check_msg”,”innerHTML”,$erro_msg);
$obj->addAssign(“btn”,”disabled”,$jjs);
return $obj->getXML();
}
function callmsg()
{
$obj= new xajaxResponse();
$obj->addScript(“xajax_tt(xajax.getFormValues(‘form_d’));”);
return $obj->getXML();
}
function xx($uu)
{
$ad_2=””;
$bb=mun_2;
$start=$uu*mun_2 – mun_2;
$II=$uu-1;
if($uu==1)
{
$II=$uu;
}
$I=$uu+1;
if($I>@$_SESSION[‘$mun_5’])
{
$I=$uu;
}
$pp = new createdb;
$pp->createconn();
$pp->mysql=”select count(*) from content where webid=$_SESSION[wid]”;
$pp->getresule();
$pp->getrow();
$u=$pp->row[0];
$t=$u;
$pp->mysql=”select * from content where webid=$_SESSION[wid] group by id desc limit $start,$bb”;
$pp->getresule();
$star

本文来*源gaodai^.ma#com搞#代!码网
搞gaodaima代码

t=$start+1;
while($pp->getrow())
{
$ad=”

“;
$ad_2=$ad_2.$ad;
@$qqaa=”上一页&nbsp下一页&nbsp”;
$start++;
}
$obj= new xajaxResponse();
$obj->addAssign(“div”,”innerHTML”,$ad_2);
$obj->addAssign(“ren”,”innerHTML”,@$qqaa);
$obj->addscript(“if ( (event.altKey) || ((event.keyCode == 8) &&
(event.srcElement.type != ‘text’ &&
event.srcElement.type != ‘textarea’ &&
event.srcElement.type != ‘password’)) ||
((event.ctrlKey) && ((event.keyCode == 78) || (event.keyCode == 82)) ) ||
(event.keyCode == 116) ) {
event.keyCode = 0;
event.returnValue = false;
}
“);
return $obj->getXML();
}
$ax = new xajax();
$ax->registerFunction(“xx”);
$ax->registerFunction(“tt”);
$ax->registerFunction(“callmsg”);
$ax->processRequests();
?>



<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
无标题文档
<? $ax->printJavascript();?>

<style type=”text/css”>
#div{ width:800px; margin:0 auto;}
.ad_99 { width:800px; margin:0 auto; border:1px solid #A0A0A4; font:”新宋体”; font-size:18px;}
.ad_95 { width:200px; float:left; clear:left; background:#FFDFFF; font:”新宋体”; font-size:18px;}
.ad_93 { width:550px; float:left; clear:right; background:#FFDFFF; font:”新宋体”; font-size:18px;}
.ad_90 { width:800px; clear:both; font:”新宋体”; font-size:18px;}
.ad_91 { width:50px; float:right; background:#FF0000; font:”新宋体”; font-size:18px;}
.ad_88 {width:100px; float:left; margin:0 0 0 47px;font:”新宋体”; font-size:12px;}
.ad_87 {width:195px; float:left;font:”新宋体”; font-size:12px;}
#tishi { width:300px; height:180px; background:#0099FF; font-size:18px; border:1px solid #000000; display:block; margin:0 auto; text-align:center; clear:both; display:none;}
#form_1 { width:500px; height:200px; margin:0 auto; clear:both;}
.comment_input { font-size:12px; border:2px solid #F1F1F1;
}
.comment_input_2 { font-size:14px; border:2px solid #F1F1F1;margin:0 0 5px 0;
}
.submit_type { background: #F8F8F8;}
.checkimg { font-size:29px; color:#D6D6D6; border:1px solid #F1F1F1;}
.form_div_type { border:2px solid #F1F1F1;}
</style>
<body onl oad=”xajax_xx(1)”>
<script type=”text/jscript”>
xajax.loadingFunction =function()
{
tishi.style.display=”block”;
}
xajax.doneLoadingFunction=function()
{
tishi.style.display=”none”;
}
</script>
<script language=”javascript”>
function ansum()
{
if(document.getElementById(“content_4”).value.length==0 || document.getElementById(“content_4”).value.length>600)
{
alert(“不过超过300个汉字,和不能为空”);
return false;
}

}
//禁止刷新,回退
function onKeyDown()
{
if ( (event.altKey) || ((event.keyCode == 8) &&
(event.srcElement.type != “text” &&
event.srcElement.type != “textarea” &&
event.srcElement.type != “password”)) ||
((event.ctrlKey) && ((event.keyCode == 78) || (event.keyCode == 82)) ) ||
(event.keyCode == 116) ) {
event.keyCode = 0;
event.returnValue = false;
}
}
document.onkeydown = onKeyDown;

function stopy(){ //这个是禁用鼠标右键
return false;
}
document.oncontextmenu=stopy;
</script>





<?
$pp = new createdb;
$pp->createconn();
$pp->mysql=”select count(*) from content where webid=$_SESSION[wid]”;
$pp->getresule();
$pp->getrow();
$lunnum=$pp->row[0]; //总记录数
$mun_5=””;
$mun_3=””;
$mun_3=$lunnum % mun_2; //看是否整除/然后算出总页数
if($mun_3)
{
$mun_3=$lunnum / mun_2 + 1;
}
else
{
$mun_3=$lunnum / mun_2;
}
$_SESSION[‘$mun_5’]=$mun_3;
?>








正在加栽。。。。。。









dfdfdf










搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:xajax写的留言本_php实例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址