Forum Moderators: coopster

Message Too Old, No Replies

table insert while page reload

         

ekram

5:39 am on Jan 19, 2005 (gmt 0)

10+ Year Member



i design a form that post some value to same php page, and i write some code in the page which is responsible for insert the values into database table, i use if submit = 'add' to execute that part of code. thats works nice but when i reload(using browser reload button)the page everytime it insert the same value to the database again and again.

is there any good way to prevent this? plz

i'll be happy to learn all solutions for the problem.

thanks in advance
emon

dkin

6:47 am on Jan 19, 2005 (gmt 0)

10+ Year Member



you could do something like

if ($var == $row[whatever])
{
echo 'This is already in our database.';
exit;
}
else
{
INSERT
}

more ways then this but it would work.