当前位置: 首页 > 图文教程 > 网络编程 > PHP > 一个个人网页自动化生成系统

PHP
PHP 柱状图实现代码
PHP 用数组降低程序的时间复杂度
PHP 读取文件内容代码(txt,js等)
Php 构造函数construct的前下划线是双的_
PHP 采集程序中常用的函数
一个比较简单的PHP 分页分组类
php下图片文字混合水印与缩略图实现代码
php5 图片验证码实现代码
phpmyadmin导入(import)文件限制的解决办法
php smarty模版引擎中变量操作符及使用方法
Php Mssql操作简单封装支持存储过程
php实现的仿阿里巴巴实现同类产品翻页
php入门教程 精简版
将文件夹压缩成zip文件的php代码
PHP开发过程中常用函数收藏
php csv操作类代码
php遍历目录viewDir函数
PHP 基本语法格式
php生成xml简单实例代码
PHP下编码转换函数mb_convert_encoding与iconv的使用说明

PHP 中的 一个个人网页自动化生成系统


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-23   浏览: 47 ::
收藏到网摘: n/a

当你希望用本系统创建你的个人主页之前,笔者相信你已经配置好了相关的阿帕奇服务器,MYSQL数据库,以及php。
接着启动你的mysql数据库,建立一个名为study的数据库,建立一个名为wenzhang的表。
在phpMyAdmin下建立如下字段:

idsmallint(5)No0auto_increment
timuvarchar(200)Yes
zuozhevarchar(18)Yes
laiyuanvarchar(40)Yes
textttextYes
riqidatetimeYes
单页递交。文件名:input.php
<html>
<head>
<title>UntitledDocument</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</head>

<bodybgcolor="#FFFFFF"background="image/b-graingr1.jpg">
<formmethod="post"action="shengcheng.php">
<tablewidth="750"border="1"align="center">
<tr>
<tdwidth="53">标题:</td>
<tdcolspan="3">
<inputtype="text"name="timu"size="50">
</td>
</tr>
<tr>
<tdwidth="53"height="28">作者:</td>
<tdwidth="154"height="28">
<inputtype="text"name="zuozhe"size="20">
</td>
<tdwidth="59"height="28">来源:</td>
<tdwidth="456"height="28">
<inputtype="text"name="laiyuan"size="30">
</td>
</tr>
<tr>
<tdwidth="53">正文:</td>
<tdcolspan="3">
<textareaname="textt"cols="90"rows="20"></textarea>
</td>
</tr>
<tr>
<tdwidth="53"></td>
<tdcolspan="3">
<inputtype="submit"name="Submit"value="递交">
<inputtype="reset"name="Submit2"value="复位">
</td>
</tr>
</table>
</form>
</body>
</html>
单页生成,文件名:shengcheng.php
<html>

<bodybackground="image/b-graingr1.jpg">

<?php

$db=mysql_connect("localhost","root");

mysql_select_db("study",$db);
//把文章写入数据库
$t=date("Y-m-dh:i:s");
$sql="INSERTINTOwenzhang(timu,zuozhe,laiyuan,textt,riqi)
VALUES('$timu','$zuozhe','$laiyuan','$textt','$t')";
$result=mysql_query($sql);
//把计数器加一
$fdd=fopen("count.txt","r");
$cdd=fread($fdd,5);
$cdd++;
fclose($fdd);
$fdd=fopen("count.txt","w");
fwrite($fdd,$cdd);
fclose($fdd);
//文章生成
$muoban1=fopen("muoban1.txt","r");
$muoban2=fopen("muoban2.txt","r");
$muoban3=fopen("muoban3.txt","r");
$qita="<p><tablewidth="75%"border="0"align="center">
<tr>
<tdclass=p9>
<divalign="center">作者:<fontcolor="#306800">$zuozhe</font>