Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Duplicate php value (https://www.warriorforum.com/programming/20094-duplicate-php-value.html)

komrad 13th October 2008 07:45 PM

Duplicate php value
 
Hello all,

I'm a learning php this year but i encounters some problems.

One of them is about php value. The problem is how do i do to prevent a php file from resending the same values into the database whenever the page is refreshed?

Anyone help?


Thanks,

Asep

Emilian 13th October 2008 09:21 PM

Re: Duplicate php value
 
Check the database and see if the data is there already. If it is, then do not enter it, if it is not then enter it.

Sean Kelly 14th October 2008 09:18 AM

Re: Duplicate php value
 
You can use a cookie or session variable to determine if the current page has already been submitted to decide if you should do an insert or not.

Sean

Emilian 14th October 2008 10:08 AM

Re: Duplicate php value
 
Cookies can be changed client side and sessions can be hijacked. If you need something solid then check on the server side and not the client side. Otherwise you will end up with duplicate values.


All times are GMT -6. The time now is 03:11 PM.