Home Backend Development PHP Tutorial php access message board program_PHP tutorial

php access message board program_PHP tutorial

Jul 13, 2016 pm 05:04 PM
access mysql php no and payment message board of program

php access message board program This is not a php and mysql message board program, but a simple and practical php access message board program that uses adodb to connect to the access database.

php tutorial access message board program
This is not a message board program for php and mysql tutorials, but a simple and practical php access message board program that uses adodb to connect to the access database tutorial.
*/

error_reporting(0);
$conn = new com("adodb.connection");
$conn->open("driver={microsoft access driver (*.mdb)}; dbq=" . realpath("db.mdb "));
$rs=new com("adodb.recordset");

$abc = $_get["abc"]; $webn = $_post["webn"]; $name = $_post["name"]; $pws = $_post["pws"]; $newpws = $_post["newpws"];
$rs->open("select * from [web]",$conn,1,1);
$adminname = $rs->fields(1)->value;
$adminpws = $rs->fields(2)->value;
$ll = $rs->fields(3)->value;
$webname = $rs->fields(4)->value;
$rs->close();
$admincookie = $adminname;

$conn->execute("update [web] set [ll] = '$ll'+1"); //$rs->close();
?>




<? echo $webname ?>


if ($abc=="admin"){
if ($name==$adminname && $pws==$adminpws){
setcookie("admin", $admincookie, time()+3600); header("location:./");
}else{echo "<script>alert('Username or password is wrong!');history.back();</script>";}
}

if ($abc=="exit"){
setcookie("admin", "", time()-3600); header("location:./");
}

if ($abc=="editadmin"){
if (!$webname || !$name || !$pws){
echo "<script>alert('Guestbook, username, original password cannot be empty!');history.back();</script>";
}
if ($pws!=$adminpws){
echo "<script>alert('May the password be wrong!');history.back();</script>";
}
if($newpws!=""){
$conn->execute("update [web] set [webname] = '$webname' , [name] = '$name' , [pws] = '$newpws'");
$conn->close(); //$conn=null;
echo "<script>alert('Modification successful, please log in again!');location='?abc=exit';</script>";
}else{
$conn->execute("update [web] set [webname] = '$webn' , [name] = '$name'");
$conn->close(); //$conn=null;
echo "<script>alert('Modification successful!');location='./';</script>";
}
}
?>


管理 修改资料 安全退出

 


  用户名:
  密码:
  
 



 

  留言本:
  

  用户名:
  原密码:
  新密码:
  
 


$id=$_get['id'];
$sj=date('y-m-d');
if($abc=="add"){
 $nr=$_post['nr'];
 $ip=getenv("remote_addr");
 if (!$nr){
 echo "<script>alert('留言不能为空!');history.back();</script>";
 }else{
 $conn->execute("insert into [txt] (nr,sj) values ('$nr','$sj')");
 }
 echo "<script>alert('操作成功!');location='./';</script>";
 $conn->close(); $conn=null;
}
 
if($abc=="del"){
 $conn->execute("delete from [txt] where [id]=".$id);
 $conn->close(); $conn=null; header("location:./");
}

if($abc=="edit"){
 $nr=$_post['nr'];
 $hf=$_post['hf'];
 $conn->execute("update [txt] set [nr] = '$nr' , [hf] = '$hf' where [id]=".$id);
 $conn->close(); $conn=null; header("location:./");
}
 
$zd=$_get['zd']; 
if($zd!=""){
 if($zd=="0")$zd=1; else $zd=0;
 $conn->execute("update [txt] set [zd] = '$zd' where [id]=".$id);
 $conn->close(); $conn=null; header("location:./");
}
?>











//分页
$rs->open("select * from [txt] order by [zd] desc, [sj] desc",$conn,1,3);
$rs->pagesize=5;
$page=trim($_get['page']);
if($page=="" || is_numeric(intval($page))<=0){$page=1;}else if(intval($page)>$rs->pagecount){$page=$rs->pagecount;}
$page=intval($page);
 if(!$rs->eof||$rs->bof){
  $rs->absolutepage=$page; $mypagesize=$rs->pagesize; $i=$rs->recordcount()-($page-1)*$rs->pagesize; 
  while(!$rs->eof && $mypagesize>0 && $i>=$rs->recordcount()-1-$rs->pagesize*$page){
   $id = $rs->fields(0)->value;
   $nr = $rs->fields(1)->value;
   $hf = $rs->fields(2)->value;
   $sj = $rs->fields(3)->value;
   $zd = $rs->fields(4)->value;
?>



置顶 】"; else echo "id.".$i; ?>
 
操作: |
修改/回复 |
删除



date:






 

 留言:

 回复:

 操作:
 

 

 $nr = str_replace("n","n".'
',$nr);
 $nr = str_replace(" ",' ',$nr);
 echo $nr."
";
?> 
 if ($hf!=""){
  echo "回复:";
  $hf = str_replace("n","n".'
',$hf);
  $hf = str_replace("  ",'  ',$hf);
  echo $hf."
";
 }
?>


movenext; $mypagesize--; $i--; } } //分页循环 ?>


留言数(recordcount(); ?>)
首页
上页
/pagecount;?>页
下页
尾页 
访问量(

close(); $rs=null; $conn->close(); $conn=null; ?>


数据库结构
id name pws ll webname
1 abc abc 4 abc 留言本 php+acc

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/630806.htmlTechArticlephp access 留言板程序这里不是php与mysql的留言板程序,而是一款简单实用的php access 留言板程序哦,利用了adodb来连接access数据库哦。 php教程...
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)

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

What are the plugins for wordpress blocking ip What are the plugins for wordpress blocking ip Apr 20, 2025 am 08:27 AM

WordPress IP blocking plugin selection is crucial. The following types can be considered: based on .htaccess: efficient, but complex operation; database operation: flexible, but low efficiency; firewall: high security performance, but complex configuration; self-written: highest control, but requires more technical level.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

How to safely store JavaScript objects containing functions and regular expressions to a database and restore? How to safely store JavaScript objects containing functions and regular expressions to a database and restore? Apr 19, 2025 pm 11:09 PM

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

How to parse next-auth generated JWT token in Java and get information in it? How to parse next-auth generated JWT token in Java and get information in it? Apr 19, 2025 pm 08:21 PM

In processing next-auth generated JWT...

SQL vs. MySQL: Clarifying the Relationship Between the Two SQL vs. MySQL: Clarifying the Relationship Between the Two Apr 24, 2025 am 12:02 AM

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

Compare and contrast MySQL and MariaDB. Compare and contrast MySQL and MariaDB. Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

See all articles