动态创建PHP页面 [英] Create a PHP Page Dynamically

查看:60
本文介绍了动态创建PHP页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以动态创建一个php页面?例如,当添加一个

用户时,我想在他们名字的目录中创建一个页面,所以

用户可以去 www.mysite.com/jack www.mysite.com/jill

index.php将在那里创建。我知道围绕这个有很多方法

但是我想知道是否可以在

服务器上创建一个php页面。谢谢。

史蒂夫。

Is it possible to create a php page dynaimically? For example, when a
user is added I''d like to create a page in a directory in their name so
users could go to www.mysite.com/jack or www.mysite.com/jill and
index.php will have been created there. I know there are many ways
around this but I''d like to know if a php page can be created on the
server. Thanks.
Steve.

推荐答案

Noyb写道:
是否可以创建一个php页面动态吗?例如,当添加一个
用户时,我想在他们名字的目录中创建一个页面
这样用户就可以去 www.mysite.com/jack www.mysite.com/jill
index.php将在那里创建。我知道有很多方法可以解决这个问题,但我想知道是否可以在
服务器上创建一个php页面。谢谢。
史蒂夫。
Is it possible to create a php page dynaimically? For example, when a
user is added I''d like to create a page in a directory in their name
so users could go to www.mysite.com/jack or www.mysite.com/jill and
index.php will have been created there. I know there are many ways
around this but I''d like to know if a php page can be created on the
server. Thanks.
Steve.




是的。

http://www.php.net/manual/en/ref.filesystem.php


>是否可以动态创建一个php页面?例如,当添加
>Is it possible to create a php page dynaimically? For example, when a
用户时,我想在名称中的目录中创建一个页面,以便用户可以转到 www.mysite.com/jack www.mysite.com/jill
index.php将在那里创建。我知道有很多方法可以解决这个问题,但我想知道是否可以在
服务器上创建一个php页面。谢谢。
user is added I''d like to create a page in a directory in their name so
users could go to www.mysite.com/jack or www.mysite.com/jill and
index.php will have been created there. I know there are many ways
around this but I''d like to know if a php page can be created on the
server. Thanks.




您可以编写一个PHP页面来完成各种各样的工作,具体取决于它是如何被调用的。例如,它查看它叫什么名字

,在数据库中查找,并根据用户的条目向用户吐出
的页面。如果页面

遵循模式而不是完全自由格式,则效果最佳。对于

的例子,我怀疑Ebay商品的待售页面是生成一个模板的
,还有一些卖家提供的部分,包括文字,

html,也许是一些图片(或者至少是图片的链接

在其他地方托管)。 (我不知道Ebay是否使用PHP)。


是的,你可以在文档树中创建文件,如果权限是

设置为做这个。我真的非常小心,让我们用
用户创建PHP页面,这些页面也可以在文件系统上写入:它是非常容易打开安全漏洞的b / b这条路。如果你真的想这样做,请参阅fopen(),例如

示例,带有文件名参数。


Gordon L. Burditt



You can write one PHP page that does all sorts of stuff depending
on how it is called. For example, it looks at what name it was
called under, looks this up in a database, and spits out a page for
the user based on his entries there. This works best if the pages
follow a pattern rather than being completely free-form. For
example, I suspect that Ebay item-for-sale pages are generated out
of a template, with some seller-supplied pieces, including text,
html, and maybe a few images (or at the very least, links to images
hosted elsewhere). (I have no idea whether Ebay uses PHP, though).

Yes, you can create files in the document tree, if permissions are
set up to do this. I''d be REALLY, REALLY careful about letting
users create PHP pages which can ALSO write on the filesystem: it''s
very easy to open up security holes this way. See fopen(), for
example, with a filename argument, if you really want to do this.

Gordon L. Burditt


Gordon Burditt写道:
Gordon Burditt wrote:
是否有可能创建一个动态的PHP页面?例如,当添加
用户时,我想在名称中的目录中创建一个页面,以便用户可以转到 www.mysite.com/jack www.mysite.com/jill
index.php将在那里创建。我知道有很多方法可以解决这个问题,但我想知道是否可以在
服务器上创建一个php页面。谢谢。
Is it possible to create a php page dynaimically? For example, when a
user is added I''d like to create a page in a directory in their name so
users could go to www.mysite.com/jack or www.mysite.com/jill and
index.php will have been created there. I know there are many ways
around this but I''d like to know if a php page can be created on the
server. Thanks.



您可以编写一个PHP页面来执行各种各样的操作,具体取决于它的调用方式。例如,它查看它被调用的名称,在数据库中查找它,并根据用户的条目为用户吐出一个页面。如果页面
遵循模式而不是完全自由形式,则效果最佳。对于
示例,我怀疑Ebay商品的销售页面是由模板生成的,有一些卖家提供的作品,包括文字,
html,也许还有一些图片(或至少,链接到图像
托管在其他地方)。 (我不知道Ebay是否使用PHP)。

是的,如果设置了权限,你可以在文档树中创建文件。我真的非常小心,让用户创建可以在文件系统上编写的PHP页面:它很容易以这种方式打开安全漏洞。如果您真的想这样做,请参阅fopen(),例如,带有文件名参数。

Gordon L. Burditt


You can write one PHP page that does all sorts of stuff depending
on how it is called. For example, it looks at what name it was
called under, looks this up in a database, and spits out a page for
the user based on his entries there. This works best if the pages
follow a pattern rather than being completely free-form. For
example, I suspect that Ebay item-for-sale pages are generated out
of a template, with some seller-supplied pieces, including text,
html, and maybe a few images (or at the very least, links to images
hosted elsewhere). (I have no idea whether Ebay uses PHP, though).

Yes, you can create files in the document tree, if permissions are
set up to do this. I''d be REALLY, REALLY careful about letting
users create PHP pages which can ALSO write on the filesystem: it''s
very easy to open up security holes this way. See fopen(), for
example, with a filename argument, if you really want to do this.

Gordon L. Burditt




谢谢戈登。我明白你在谈论什么,但是告诉人们去
方便_blank> www.mysite.com/jack
就是我想要的b $ b。 Nik C.发布的答案

http://www.php.net/manual/en/ref.filesystem.php )正是我所寻找的b $ b,以防万一其他人在想。



Thanks Gordon. I understand what you''re talking about but the
convenience of telling people to go to www.mysite.com/jack is what I was
looking for. The answer posted by Nik C.
(http://www.php.net/manual/en/ref.filesystem.php) is just what I was
looking for in case anyone else out there is wondering.


这篇关于动态创建PHP页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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