Reply to multiple submit problems, Help

Your name:

Reply:


Posted by Jeff on 01/20/07 21:54

Hey

I'm developing a web site using php 5.2.0

But now I've run into a problem about multiple submit of a form. This web
page consist of a form and a submit button.

So when the form submit the new data is added to the table, then the php
script add the id of the new record into hidden field in the form: echo
"<input type='hidden' name='property' value='".$id."' />";

But when the user clicks on the refresh button in the browser, then the form
is submitted again but my hidden field isn't sent. It looks like the browser
don't care about the values in the form, it just send again the values from
the last submit. To tryed to fix this problem by manually in the code add
the $id to the $_POST array:
$_POST["property"] = $id; - But that did NOT solved the problem. To me it
looks like the browser discard the values I manually enter into $_POST..

Here are some other fixes I tryed but which also FAIL (basically here I try
to add the $id into the URL)
if (empty($id)) {
echo "<form action='index.php?mode=profile&amp;style=add&amp;opt=1'
method='post' >";
} else {
echo "<form
action='index.php?mode=profile&amp;style=add&amp;opt=1&amp;property=".$id."
method='post' >";
}
OR
if (isset($id)) {
echo "<form
action='index.php?mode=profile&amp;style=add&amp;opt=1&amp;property=".$id."
method='post' >";
} else {
echo "<form action='index.php?mode=profile&amp;style=add&amp;opt=1'
method='post' >";
}

I believe i can solve this problem if I can get the value of $id sent along
with the the refresh/submit, but I'm stucked on how..

Any suggestions?

Jeff

[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

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