Reply to Re: unsetting

Your name:

Reply:


Posted by Shelly on 11/14/06 21:13

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:5d6dnRuvDbzJKMTYnZ2dnUVZ_rGdnZ2d@comcast.com...
> Shelly wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:EJSdnWsIGMcLqcTYnZ2dnUVZ_r-dnZ2d@comcast.com...
>>
>>>Shelly wrote:
>>>
>>>>I have the following for a test of the submit button being pressed:
>>>>
>>>>if (isset($_POST['theSubmitButton'])) {
>>>>
>>>>This works fine and I have been doing this for a long time. Here is the
>>>>question:
>>>>
>>>>If I do a submit and have it come back to the same page, all is fine.
>>>>If I now click the browser refresh button, I get another submittal. How
>>>>do I "unset" the status so that it doesn't think I clicked the submit
>>>>button when I click the refresh button?
>>>>
>>>>Shelly
>>>>
>>>>
>>>
>>>You can't just unset a $_POST variable (well, you can, but it won't work
>>>like you want). When your user hits reload on the browser, the browser
>>>will resend the post, setting it again.
>>>
>>>You can, for instance, have the submit button go to another page to
>>>process the data, then redirect back to your original page with a
>>>header() call.
>>
>>
>> I already tried something like this just after I submitted the original
>> post. I had the original submit button force the processing of the post
>> and at the end of that processing it was sent to another page,
>> pageRedir.php, via a header. In pageRedir.php I had it go immediately
>> via a header back to the original page. A refresh of that original page
>> then still resulted in another processing.
>>
>> Anyway, a refresh would still satisfy the isset for the submit button so
>> it would still be sent to another page. I don't see how this gains
>> anything.
>>
>
> That's because you didn't do it like I described. You must have a
> DIFFERENT page doing the processing. You can then redirect back to the
> original page, if you wish.

Got it! I wrote a little test pair and it worked just as you said. Thanks.

Shelly

[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

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