Message book written by xajax

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); // defines the number of records displayed on each page.
Function tt ($ form_mm)
{
If ($ _ SESSION ["code"] = $ form_mm ['chetxt ']) // use xajax to obtain the verification code. Unlike the previous one, check whether the verification code is correct.
{
$ Erro_msg = "thank you for your support ";
$ Jjs = "";
}
Else
{
$ Erro_msg = "the verification code is incorrect. Please write it 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 '> alias ". $ pp-> row ["tallname"]. "</div> <div class = 'ad _ 93 '> advertisement :". $ pp-> row ["tellall"]. "</div> <div class = 'ad _ 91 '> ". $ start. "Floor </div> <div class = 'ad _ 90'> content :". $ pp-> row ["txtconntent"]. "</div> ";
$ Ad_2 = $ ad_2. $ ad;
@ $ Qqaa = "<span onclick = 'xajax _ xx ($ II) 'style = 'cursor: pointer '> previous page </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! = 'Textea '&&
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">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<? $ Ax-> printJavascript ();?>
</Head>
<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 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 ("cannot exceed 300 Chinese characters, and cannot be blank ");
Return false;
}

}
// Refresh prohibited and rollback
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 () {// right-click 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]; // The total number of records.
$ Mun_5 = "";
$ Mun_3 = "";
$ Mun_3 = $ lunnum % mun_2; // check whether the partition is complete/then calculate 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 number of comments: <? Echo ($ lunnum);?> </Div>
<Div class = "ad_87"> <span id = "ren"> </span> </div>
<Div class = "ad_87"> page number:
<?
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 users: </div>
<Div id = "tishi">
<P> </p>
<P> </p>
<P> planting ......
</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 = "Verification Code" size = "8" maxlength = "8" onblur = "xajax_callmsg () "/>
<Span id = "check_msg"> dfdfdf </span> <br>
<Textarea name = "content_4" cols = "70" rows = "10" class = "comment_input"> </textarea>



<Input name = "btn" type = "submit" id = "btn" value = "submit a message" class = "submit_type" disabled = "true"/>
</Form>
</Div>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.