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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

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's Place: Databases and Programming MySQL's Place: Databases and Programming Apr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

PHP's Current Status: A Look at Web Development Trends PHP's Current Status: A Look at Web Development Trends Apr 13, 2025 am 12:20 AM

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP vs. Python: Core Features and Functionality PHP vs. Python: Core Features and Functionality Apr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP: The Foundation of Many Websites PHP: The Foundation of Many Websites Apr 13, 2025 am 12:07 AM

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

How to use Debian Apache logs to improve website performance How to use Debian Apache logs to improve website performance Apr 12, 2025 pm 11:36 PM

This article will explain how to improve website performance by analyzing Apache logs under the Debian system. 1. Log Analysis Basics Apache log records the detailed information of all HTTP requests, including IP address, timestamp, request URL, HTTP method and response code. In Debian systems, these logs are usually located in the /var/log/apache2/access.log and /var/log/apache2/error.log directories. Understanding the log structure is the first step in effective analysis. 2. Log analysis tool You can use a variety of tools to analyze Apache logs: Command line tools: grep, awk, sed and other command line tools.

See all articles