Giter Club home page Giter Club logo

jishiben's Introduction

修改自

下载文件,相应的文件结构应如下

.
├── index.php
├── favicon.svg
├── script.js 
└── styles.css 

打开 index.php,填写 $host $username $password $dbname,分别对应 MySQL 数据库的 地址 用户名 密码 数据库名称

登陆 MySQL 数据库,输入以下 SQL 命令,检测数据表是否需要初始化操作

  1. 判断数据库中是否存在 notes 的数据表
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'notes';

如果正常显示了 notes,则结束此阶段。如果没有,则进行第二步

  1. 初始化数据表
CREATE TABLE notes (
    id INT(11) NOT NULL AUTO_INCREMENT,
    note_name VARCHAR(64) NOT NULL,
    note_content MEDIUMTEXT,
    PRIMARY KEY (id),
    UNIQUE KEY (note_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

在没有错误其他的前提下,如果检测数据表正确,但无法正常写入内容,说明 notes 数据表可能不是由本项目所创建的,表结构有所不同,请考虑更改 index.php 中的数据表名称,并初始化(别忘了修改初始化命令中的 notes 为新名称)。或删除原有的 notes 表,重新初始化

如果使用 Apache 网页服务,写入以下内容到 .htaccess 文件,放到网站目录

Options -Indexes
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?note=$1 [QSA]

<IfModule mod_headers.c>
    Header set X-Robots-Tag: "noindex, nofollow"
</IfModule>

如果使用 Nginx 网页服务,在配置文件中添加下列内容

location / {
    rewrite ^/([a-zA-Z0-9_-]+)$ /index.php?note=$1;
}

jishiben's People

Contributors

zzdwugouzi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.