使用php扩展名创建文件 [英] Create a file with html extention with php

查看:95
本文介绍了使用php扩展名创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一些页面的cms供用户更改页面,但是我想让可以在其站点中添加新HTML页面并在其中放置数据的用户使用php来做到这一点? />

I have a cms with some page for the users to alter the pages but I want to let the user that can Add new Html page in his/her site and put data in that how can I do this with php?
any idea?

推荐答案

通常,您将拥有一个由数据库驱动的页面,并显示用户添加的任何内容,这些内容存储在D b.与允许用户在文件系统中创建HTML页面相比,这是一个更好的设计.因此,假设您有一个名为custom.php的页面,以及诸如custom.php?id = 47之类的网址,其中47是唯一标识dB内容的ID.您需要检查登录用户是否添加了该项目(如果这些项目是私有的).当所有这些都在数据库中时,也可以更轻松地对其进行管理.
Usually you''d have a page that''s driven by the database, and shows whatever content the user added, which is stored in the dB. This is a much nicer design than letting users create HTML pages in your file system. So, you''d have a page called custom.php, say, and urls like custom.php?id=47, where 47 is the id that uniquely identifies the content in the dB. You''d want to check that this item was added by the logged in user, if the items are to be private. This is also more easily managed when it''s all in the DB.


这篇关于使用php扩展名创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆