


A personal web page automatic generation system 1_PHP tutorial
Jul 13, 2016 pm 05:26 PM
Before you want to use this system to create your personal homepage, I believe you have already configured the relevant Apache server, MYSQL database, and PHP.
Then start your mysql database, create a database named study, and create a table named wenzhang.
Create the following fields under phpMyAdmin:
id smallint(5) No 0 auto_increment
timu varchar(200) Yes
zuozhe varchar(18) Yes
laiyuan varchar(40) Yes
textt text Yes
riqi datetime Yes
Single page submission. File name: input.php
Single page generation, file name: shengcheng.php
$db = mysql_connect ("localhost", "root");
mysql_select_db("study",$db);
// Write the article to the database
$t = date("Y-m-d h:i:s") ;
$sql = "INSERT INTO wenzhang (timu,zuozhe,laiyuan,textt,riqi)
VALUES ($timu,$zuozhe,$laiyuan,$textt,$t)";
$result = mysql_query($sql);
// Increment the counter by one
$fdd=fopen("count.txt","r");
$cdd=fread($fdd,5);
$cdd++;
fclose($fdd);
$fdd=fopen("count.txt","w");
fwrite($fdd,$cdd);
fclose($ fdd);
// Article generation
$muoban1 = fopen("muoban1.txt","r");
$muoban2 = fopen("muoban2.txt","r");
$muoban3 = fopen("muoban3.txt","r");
$qita = "
Author: $zuozhe

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to send web pages to desktop as shortcut in Edge browser?

CUDA's universal matrix multiplication: from entry to proficiency!

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time

Understand Linux Bashrc: functions, configuration and usage

What should I do if the images on the webpage cannot be loaded? 6 solutions

Introduction to methods for individuals to join corporate WeChat
