Reply to Re: [PHP] Forms on PHP

Your name:

Reply:


Posted by Richard Lynch on 10/08/22 11:05

PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> I am new to this or any newsgroup in PHP, as well as PHP itself, so this
> question is probably rather elementary. I have a form which on clicking
> on the "Submit" button calls up a compiled program on the server that is
> executed and writes output to a file. This file is then read by the PHP
> script and passed on for other processes.

Yikes!

What if two guys surf to the same page AT THE SAME TIME?

Is this all being taken care of?

Or is this an admin page that only one guy ever uses, and he *KNOWS* not
to run it in two different browsers at the same time? And you'll *NEVER*
try to run it for testing while he's trying to run it for real? And...

This scenario is rife with potential problems.

> When the page is first loaded,
> it knows that the "Submit" button has not been clicked, and after clicking
> the button it knows, which is of course what we want. The problem is that
> subsequently it always thinks the button has been clicked, even if the
> reload button on the browser has been clicked.

When I hit re-load, you get back *exactly* the same thing I sent you last
time.

$_POST and everything.

If you want to do something *different* then you need to keep a record of
the fact that I already POSTed this data.

For example, you could embed a http://php.net/uniqid in your FORM in a
HIDDEN INPUT, and then store that in a database, and if I POST again, you
can do whatever you want.

Don't call that external program, and just read the file from the previous
action but with an added notification that I'm reading old data, or send
me a different output, or ...

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация