You are here: Re: Idea for form action page to reduce double submissions « PHP Programming Language « IT news, forums, messages
Re: Idea for form action page to reduce double submissions

Posted by Oak Hall on 08/04/05 18:14

After a submission is sent I repond with a page that loads the new page a
redirect I guess.

example:

str="/z/sn?command=cashflow&rec="+dynvar["index"]
page="<body onload=\"window.location.replace('"+str+"');\">"+"<a
href=\""+str+"\">Cash Flow</a><BR><BR>"+chr(13)+page+"</BODY>"

basically the onload window.location.replace returns the browser to a fresh
page which will not enter a new record if refresh is clicked good luckOak


<bissatch@yahoo.co.uk> wrote in message
news:1123149661.894501.278400@z14g2000cwz.googlegroups.com...
> Hi,
>
> I have been trying to come up with an idea to reduce double submissions
> where a user clicks refresh and, for example, another row is INSERT
> into a table.
>
> Originally, I would have a form page. When a user submits the form (ie.
> index.php), I would script it so that when the form action would be the
> same page but it would use the address 'index.php?action=add'. This is
> bad (mmm-kay) as when the user refreshes the page it would add another
> row into the database table.
>
> The solution (thanks to a reply on this newsgroup) is to have a
> different page to carry out the form processing and depending on the
> result either redirect them to a successful or unsuccessful page (or
> the same page but different outcomes as a result of scripting).
>
> Anyway, my idea is very similar to the above where a user will fill in
> the form. They will then be submitted to a page called action.php. This
> action page will deal with all scripting associated with this news
> admin system I am planning, including add/edit/delete pages. They will
> be dealt with by passing the rellevant instruction with the GET
> parameters (ie. action.php?action=delete). Should an error be found
> then it will be highlighted in the action page and a link back to the
> form page will be provided with the values entered passed back using
> POST variables. In the event of a successful entry, the user will be
> redirected back to the form parent page (view article (parent) -> edit
> article (child)) with passed GET info (ie. view.php?action=add) where
> as it knows what action was carried out it can assume that it was
> successful and the 'You have successfully added a news article' message
> would be displayed.
>
> Im pretty confident that this system would be a big improvement but
> would be greatful if anyone who does this in a similar way would give
> comment. Cheers
>
> Burnsy
>

 

Navigation:

[Reply to this 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

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