Re: After INSERT form submit - Data doesn't refresh!

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

 



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@xxxxxxxxx> wrote:

> On Tue, Jul 22, 2008 at 10:51 AM, Rahul S. Johari
> <sleepwalker@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx  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
>
>

[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