Re: Forms on PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux