getXML();}functionxx($uu){$ad_2=""..." />
xajax写的留言本
xajax写的留言本
发布时间:2016-12-29 来源:查字典编辑
摘要:addScript("xajax_tt(xajax.getFormValues('form_d'));");return$obj->getX...

<?

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=newcreatedb;

$con->createconn();

$con->mysql="insertintocontent(webid,tallname,txtconntent)values('$_SESSION[wid]','$_POST[tallnane]','$_POST[content_4]')";

$con->getresule();

}

@define(mun_2,3);//定义每页显示几条记

functiontt($form_mm)

{

if($_SESSION["code"]==$form_mm['chetxt'])//用xajax来取得验证码,不同以前的那种看验证码对不对

{

$erro_msg="谢谢你的支持";

$jjs="";

}

else

{

$erro_msg="验证码不对,请重新在写";

$jjs="true";

}

$obj=newxajaxResponse();

$obj->addAssign("check_msg","innerHTML",$erro_msg);

$obj->addAssign("btn","disabled",$jjs);

return$obj->getXML();

}

functioncallmsg()

{

$obj=newxajaxResponse();

$obj->addScript("xajax_tt(xajax.getFormValues('form_d'));");

return$obj->getXML();

}

functionxx($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=newcreatedb;

$pp->createconn();

$pp->mysql="selectcount(*)fromcontentwherewebid=$_SESSION[wid]";

$pp->getresule();

$pp->getrow();

$u=$pp->row[0];

$t=$u;

$pp->mysql="select*fromcontentwherewebid=$_SESSION[wid]groupbyiddesclimit$start,$bb";

$pp->getresule();

$start=$start+1;

while($pp->getrow())

{

$ad="<divclass='ad_95'>倪称".$pp->row["tallname"]."</div><divclass='ad_93'>广告:".$pp->row["tellall"]."</div><divclass='ad_91'>".$start."楼</div><divclass='ad_90'>内容:".$pp->row["txtconntent"]."</div>";

$ad_2=$ad_2.$ad;

@$qqaa="<spanonclick='xajax_xx($II)'style='cursor:pointer'>上一页</span> <spanonclick='xajax_xx($I)'style='cursor:pointer'>下一页</span> ";

$start++;

}

$obj=newxajaxResponse();

$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=newxajax();

$ax->registerFunction("xx");

$ax->registerFunction("tt");

$ax->registerFunction("callmsg");

$ax->processRequests();

?>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>

<title>无标题文档</title>

<?$ax->printJavascript();?>

</head>

<styletype="text/css">

#div{width:800px;margin:0auto;}

.ad_99{width:800px;margin:0auto;border:1pxsolid#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:00047px;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:1pxsolid#000000;display:block;margin:0auto;text-align:center;clear:both;display:none;}

#form_1{width:500px;height:200px;margin:0auto;clear:both;}

.comment_input{font-size:12px;border:2pxsolid#F1F1F1;

}

.comment_input_2{font-size:14px;border:2pxsolid#F1F1F1;margin:005px0;

}

.submit_type{background:#F8F8F8;}

.checkimg{font-size:29px;color:#D6D6D6;border:1pxsolid#F1F1F1;}

.form_div_type{border:2pxsolid#F1F1F1;}

</style>

<bodyonload="xajax_xx(1)">

<scripttype="text/jscript">

xajax.loadingFunction=function()

{

tishi.style.display="block";

}

xajax.doneLoadingFunction=function()

{

tishi.style.display="none";

}

</script>

<scriptlanguage="javascript">

functionansum()

{

if(document.getElementById("content_4").value.length==0||document.getElementById("content_4").value.length>600)

{

alert("不过超过300个汉字,和不能为空");

returnfalse;

}

}

//禁止刷新,回退

functiononKeyDown()

{

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;

functionstopy(){//这个是禁用鼠标右键

returnfalse;

}

document.oncontextmenu=stopy;

</script>

<divclass="ad_99"></div>

<divclass="ad_99"></div>

<divid="div">

</div>

<?

$pp=newcreatedb;

$pp->createconn();

$pp->mysql="selectcount(*)fromcontentwherewebid=$_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;

?>

<divclass="ad_88">总评论数:<?echo($lunnum);?></div>

<divclass="ad_87"><spanid="ren"></span></div>

<divclass="ad_87">页码:

<?

for($i=1;$i<=$mun_3;$i++)

{

if($i<10)

{

$mun_4="<spanonclick='xajax_xx($i)'style='cursor:pointer'>$i</span>";

echo($mun_4);

}

}

if($i>10)

{

echo("..");

}

?></div>

<divclass="ad_87">当前在线人数:</div>

<divid="tishi">

<p></p>

<p></p>

<p>正在加栽。。。。。。

</p>

</div>

<divid="form_1"class="form_div_type">

<formid="form_d"name="formd"method="post"action="index.php"onsubmit="returnansum();">

<inputname="tallnane"type="text"class="comment_input_2"value="昵称"size="8"maxlength="8"/>

<inputtype="hidden"name="hidda"value="yhm"/>

<imgsrc="checkimg.php"align="absbottom"/>

<inputname="chetxt"type="text"class="checkimg"value="验证码"size="8"maxlength="8"onblur="xajax_callmsg()"/>

<spanid="check_msg">dfdfdf</span><br>

<textareaname="content_4"cols="70"rows="10"class="comment_input"></textarea>

<inputname="btn"type="submit"id="btn"value="提交留言"class="submit_type"disabled="true"/>

</form>

</div>

</body>

</html>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新php教程学习
热门php教程学习
编程开发子分类