Re: After INSERT form submit - Data doesn't refresh!
| From: | VamVan | Date: | Wed, 23 Jul 2008 21:13:59 +0000 |
| Subject: | Re: After INSERT form submit - Data doesn't refresh! | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277212@lists.php.net to get a copy of this message | ||
Hello,
I understand what you are trying to do. But as a web developer it is never a
good practice to have a insert query and page to display the record in the
same page. This way you will never add the redundant data whenever the page
is refreshed.
So from my experience I would suggest you do this:
form.php
if(isset($_GET['displayrecords']) && $_GET['displayrecords'] ==
"true") {
show records
}else{
<form action='qry_form.php'>
HTML FORM
submit
}
qry_form.php
{INSERT QUERY}
//redirect
header('location:form.php?displayrecords=true')
this intermediate step qry_form.php will insert the record and redirect to
the same page with a get variable.
This is a good practice to avoid inserting everytime you refresh the page.
Thanks
On Tue, Jul 22, 2008 at 8:12 AM, Daniel Brown <parasane@gmail.com> wrote:
> On Tue, Jul 22, 2008 at 10:51 AM, Rahul S. Johari
> <sleepwalker@rahulsjohari.com> wrote:
> >
> > I just checked a couple of other browsers (IE, Safari, Opera) and it
> seems
> > to be working fine in all the browsers except Firefox 3. I think this
> issue
> > is now out of bounds for PHP - I don't think there is anything wrong in
> the
> > script or the way I'm doing this - I think the problem is lying somewhere
> in
> > either Firefox 3 or my settings of Firefox 3. Let me look into this.
>
> If you believe that to be the case, Rahul, please report your
> findings at support-firefox@lists.mozilla.org. We (I'm a Mozilla
> developer as well) may then ask you to post portions of your
> 'about:config' to better troubleshoot the issues.
>
> --
> </Daniel P. Brown>
> Better prices on dedicated servers:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>