Home Backend Development PHP Tutorial Guestbook written by xajax_PHP tutorial

Guestbook written by xajax_PHP tutorial

Jul 21, 2016 pm 04:00 PM
once require session start x

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();
  $start=$start+1;
        while($pp->getrow())
  {
        $ad="

";
  $ad_2=$ad_2.$ad;
  @$qqaa="上一页 下一页 ";
  $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();
?>




无标题文档
printJavascript();?>


#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;}



 xajax.loadingFunction =function()
 {
  tishi.style.display="block";
 }
 xajax.doneLoadingFunction=function()
 {
  tishi.style.display="none";
 }


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;

 

 



    $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;
?>
总评论数:


页码:
    for($i=1;$i<=$mun_3;$i++)
 { 
  if($i<10)
  {
  $mun_4 = "$i ";
  echo($mun_4);
  }
 }
 if($i>10)
 {
 echo("..");
 }
 ?>
当前在线人数:

  

 


  

 


  

正在加栽。。。。。。
  




  
      
      
 
 
 dfdfdf 

      
  
        
       
  
  



www.bkjia.comtruehttp://www.bkjia.com/PHPjc/317223.htmlTechArticle? 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']...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to complete operation (Error 0x0000771) Printer error Unable to complete operation (Error 0x0000771) Printer error Mar 16, 2024 pm 03:50 PM

If you encounter an error message when using your printer, such as the operation could not be completed (error 0x00000771), it may be because the printer has been disconnected. In this case, you can solve the problem through the following methods. In this article, we will discuss how to fix this issue on Windows 11/10 PC. The entire error message says: The operation could not be completed (error 0x0000771). The specified printer has been deleted. Fix 0x00000771 Printer Error on Windows PC To fix Printer Error the operation could not be completed (Error 0x0000771), the specified printer has been deleted on Windows 11/10 PC, follow this solution: Restart Print Spool

0x80070026 error solution: win101909 version update error fix 0x80070026 error solution: win101909 version update error fix Dec 25, 2023 pm 05:10 PM

During the process of updating the system, many friends encountered the error code prompt 0x80070026 and did not know how to solve it. This situation may be due to an internal error in the system, which can be repaired in the command prompt. How to solve win101909 version update error 0x80070026 1. First launch the "Start" menu, enter "cmd", right-click "Command Prompt" and select run as "Administrator". 2. Then enter the following commands in sequence (copy and paste carefully): SCconfigwuauservstart=auto, press Enter SCconfigbitsstart=auto, press Enter SCconfigcryptsvc

The server encountered an error, 0x80070003, while creating a new virtual machine. The server encountered an error, 0x80070003, while creating a new virtual machine. Feb 19, 2024 pm 02:30 PM

If you encounter error code 0x80070003 when using Hyper-V to create or start a virtual machine, it may be caused by permission issues, file corruption, or configuration errors. Solutions include checking file permissions, repairing damaged files, ensuring correct configuration, and more. This problem can be solved by ruling out the different possibilities one by one. The entire error message looks like this: The server encountered an error while creating [virtual machine name]. Unable to create new virtual machine. Unable to access configuration store: The system cannot find the path specified. (0x80070003). Some possible causes of this error include: The virtual machine file is corrupted. This can happen due to malware, virus or adware attacks. Although the likelihood of this happening is low, you can't completely

vue3+vite: How to solve the error when using require to dynamically import images in src vue3+vite: How to solve the error when using require to dynamically import images in src May 21, 2023 pm 03:16 PM

vue3+vite:src uses require to dynamically import images and error reports and solutions. vue3+vite dynamically imports multiple images. If vue3 is using typescript development, require will introduce image errors. requireisnotdefined cannot be used like vue2 such as imgUrl:require(' .../assets/test.png') is imported because typescript does not support require, so import is used. Here is how to solve it: use awaitimport

Fix CcmSetup failed with error code: Fix CcmSetup failed with error code: Feb 19, 2024 pm 10:45 PM

When installing the ConfigurationManager client (CCMSetup), encountering an error code may cause the installation to fail. These error codes can be confusing and require different solutions to resolve. Methods to fix CcmSetup failure include handling error codes such as 0x80004004, 0x80070643, 0x80070430, 0x87d00455, 0x80041013 or 0x87d00227. By carefully checking the error codes and taking appropriate resolution measures, you can successfully install the ConfigurationManager client and ensure the normal operation of the system. Although these error codes may bring

How to solve session failure How to solve session failure Oct 18, 2023 pm 05:19 PM

Session failure is usually caused by the session lifetime expiration or server shutdown. The solutions: 1. Extend the lifetime of the session; 2. Use persistent storage; 3. Use cookies; 4. Update the session asynchronously; 5. Use session management middleware.

Solution to PHP Session cross-domain problem Solution to PHP Session cross-domain problem Oct 12, 2023 pm 03:00 PM

Solution to the cross-domain problem of PHPSession In the development of front-end and back-end separation, cross-domain requests have become the norm. When dealing with cross-domain issues, we usually involve the use and management of sessions. However, due to browser origin policy restrictions, sessions cannot be shared by default across domains. In order to solve this problem, we need to use some techniques and methods to achieve cross-domain sharing of sessions. 1. The most common use of cookies to share sessions across domains

Understand the user experience differences between vivox100s and x100 Understand the user experience differences between vivox100s and x100 Mar 23, 2024 pm 05:18 PM

With the continuous development of science and technology, people's requirements for communication equipment are also constantly increasing. In the market, Vivox100s and X100 are two mobile phone brands that have attracted much attention. They all have unique characteristics and each has its own advantages. This article will compare the user experience differences between these two mobile phones to help consumers better understand them. There are obvious differences in appearance design between Vivox100s and X100. Vivox100s adopts a fashionable and simple design style, with a thin and light body and comfortable hand feel; while X100 pays more attention to practicality

See all articles