问题描述
每次发送
表格时,有没有办法在服务器上创建单独的文本文件?
-
?触发?
当然,但为什么不使用数据库?一个堵塞的目录完整
成千上万的文本文件最终咬你。
-
没有人忘记他埋没了斧头。
- Kin Hubbard
问题出在哪里?
jue
我同意。我最近写了一个网站,需要大量的编码和很多
表格。每个表单都做了很多文本文件的读写。我只有大约30个用户(可以多次使用表单)的b $ b,但我有大约650
文件和450个文件夹。这不是要走的路。我一直在慢慢地将它转换成MySQL。
但是要回答你的问题,是的。有两种方法可以做到这一点
(假设他们没有登录。如果他们登录了那么你可以做很多
更多)。但如果他们没有登录,你可以通过ip
地址创建一个文本文件,或者可以按顺序创建文本文件。您还可以使用您在用户上拥有的任何其他数据创建
。如果您通过ip
地址创建它,如果允许用户
多次提交表单,则需要附加到该文件。
#_BEGIN_
#这是使用ip地址执行此演示的演示
#可以使用以下变量获取IP地址
Is there a way of creating a seperate text file on a server every time a
form is sent?
--
? Trigger ?
http://www.magic2k.com/
http://www.oddmap.co.uk
Certainly, but why don''t you use a database? A clogged up directory full
of thousands of text-files bites you in the end.
--
Nobody ever forgets where he buried the hatchet.
-- Kin Hubbard
Where is the problem?
jue
I agree. I recently wrote a website that requires lots of coding and lots of
forms. Each form did a lot of text file reading and writing. I only have
about 30 users (who can use forms multiple times), but I have about 650
files and 450 folders for this. It''s not the way to go. I''ve been slowly
switching it over to MySQL.
But to answer your question, yes. Therea are two ways you could do it
(assuming they aren''t logged in. If they are logged in then you can do many
more). But If they aren''t logged in, you can create a text file by ip
address, or text files can be created sequentially. You can also creat it
using any other data that you have on the user. If you create it by ip
address, you will want to append to the file if the user is allowed to
submit the form multiple times.
#_BEGIN_
# this is a demonstration of using the ip address to do it
# the ip address can be gotten using the following variable
这篇关于写入文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!