Xajax Write a message this _php instance
Last Update:2017-01-18
Source: Internet
Author: User
?
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); Define a few notes per page
function tt ($form _mm)
{
if ($_session["code"]== $form _mm[' chetxt '])//Xajax to obtain the verification code, different before the kind of look at the verification code is not right
{
$erro _msg= "Thank you for your support";
$JJS = "";
}
Else
{
$erro _msg= "Verify code is wrong, please write again";
$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 ();
$start = $start +1;
while ($pp->getrow ())
{
$ad = "<div class= ' ad_95 ' > Kan". $pp->row["Tallname"]. " </div><div class= ' ad_93 ' > Advertising: ". $pp->row[" Tellall "]." </div><div class= ' ad_91 ' > '. $start. " Building </div><div class= ' ad_90 ' > Content: ". $pp->row[" Txtconntent "]." </div> ";
$ad _2= $ad _2. $ad;
@ $qqaa = "<span onclick= ' xajax_xx ($II) ' style= ' Cursor:pointer ' > prev </span> <span onclick= ' xajax_xx ($I) ' style= ' cursor:pointer ' > next page </span> ';
$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 ();
?>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
? $ax->printjavascript ();? >
<style type= "Text/css" >
#div {width:800px; margin:0 auto;}
. ad_99 {width:800px; margin:0 auto; border:1px solid #A0A0A4; font: "Neo-Arial"; font-size:18px;}
. ad_95 {width:200px; float:left clear:left; background: #FFDFFF; font: "Neo-Arial"; font-size:18px;}
. ad_93 {width:550px; float:left clear:right; background: #FFDFFF; font: "Neo-Arial"; font-size:18px;}
. ad_90 {width:800px; clear:both; font: "Neo-Arial"; font-size:18px;}
. ad_91 {width:50px; Float:right background: #FF0000; font: "Neo-Arial"; font-size:18px;}
. ad_88 {width:100px; float:left; margin:0 0 0 47px;font: "New song Body"; font-size:12px;}
. ad_87 {width:195px; Float:left;font: "Neo-Arial"; 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 onload= "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 ("but more than 300 characters, and cannot be empty");
return false;
}
}
No refresh, fallback
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 () {//This is the right mouse button disabled
return false;
}
Document.oncontextmenu=stopy;
</script>
<div class= "ad_99" > </div>
<div class= "ad_99" > </div>
<div id= "div" >
</div>
?
$PP = new Createdb;
$PP->createconn ();
$PP->mysql= "SELECT COUNT (*) from content where Webid=$_session[wid]";
$PP->getresule ();
$PP->getrow ();
$lunnum = $pp->row[0]; Total number of records
$mun _5= "";
$mun _3= "";
$mun _3= $lunnum% Mun_2; See if it's divisible/then figure out the total number of pages
if ($mun _3)
{
$mun _3= $lunnum/mun_2 + 1;
}
Else
{
$mun _3= $lunnum/mun_2;
}
$_session[' $mun _5 ']= $mun _3;
?>
<div class= "ad_88" > Total Comments: Echo ($lunnum);? ></div>
<div class= "ad_87" ><span id= "Ren" ></span></div>
<div class= "ad_87" > page:
?
for ($i =1; $i <= $mun _3; $i + +)
{
if ($i <10)
{
$mun _4 = "<span onclick= ' xajax_xx ($i) ' style= ' Cursor:pointer ' > $i </span>";
Echo ($mun _4);
}
}
if ($i >10)
{
Echo ("..");
}
?></div>
<div class= "ad_87" > Current online number:</div>
<div id= "Tishi" >
<p> </p>
<p> </p>
<p> is adding ...
</p>
</div>
<div id= "form_1" class= "Form_div_type" >
<form id= "Form_d" name= "Formd" "method=" Post "action=" index.php "onsubmit=" return Ansum (); " >
<input name= "Tallnane" type= "text" class= "Comment_input_2" value= "nickname" size= "8" maxlength= "8"/>
<input type= "hidden" name= "Hidda" value= "Yhm"/>
<input name= "Chetxt" type= "text" class= "checkimg" value= "Authentication Code" size= "8" maxlength= "8" onblur= "Xajax_callmsg" ()/>
<span id= "check_msg" >dfdfdf</span> <br>
<textarea name= "Content_4" cols= "rows=" class= "" "Comment_input" ></textarea>
<input name= "BTN" type= "Submit" id= "BTN" value= "submit Message" class= "Submit_type" disabled= "true"/>
</form>
</div>
</body>