写入文本文件 [英] Writing to a text file

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

问题描述

每次发送

表格时,有没有办法在服务器上创建单独的文本文件?


-

?触发?
http://www.magic2k.com/
http://www.oddmap.co.uk

解决方案

Neil Trigger写道:

有没有办法在服务器上每次创建一个单独的文本文件
表单已发送?




当然,但为什么不使用数据库?一个堵塞的目录完整

成千上万的文本文件最终咬你。


-

没有人忘记他埋没了斧头。

- Kin Hubbard


Neil Trigger写道:

有没有办法每发送一个表单在服务器上创建一个单独的文本文件?




问题出在哪里?


jue




" Neil Trigger" < EM *** @ magic2k.com>在消息中写道

新闻:KK ******************* @ news-binary.blueyonder.co.uk ...

每次发送
表单时,有没有办法在服务器上创建单独的文本文件?




我同意。我最近写了一个网站,需要大量的编码和很多

表格。每个表单都做了很多文本文件的读写。我只有大约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

解决方案

Neil Trigger wrote:

Is there a way of creating a seperate text file on a server every time a
form is sent?



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


Neil Trigger wrote:

Is there a way of creating a seperate text file on a server every
time a form is sent?



Where is the problem?

jue



"Neil Trigger" <em***@magic2k.com> wrote in message
news:KK*******************@news-binary.blueyonder.co.uk...

Is there a way of creating a seperate text file on a server every time a
form is sent?



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


这篇关于写入文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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