How to Protect from double posting insert MySQL
Posted by Jawaad on 5 November, 2008
1 comment so far
Cara untuk supaya proteksi dari double posting suatu form ke dalam database menggunakan tehnik SESSION.
1. Set a session in the form page
session_start(); $_SESSION[post_only_once] = 1; echo ' < form method="post"> Name < input type="text" name="name"> < input type="submit" value="submit" name="submit"> < /form> ';
2. Check the session before doing INSERT into MySQL.
if($_SESSION[post_only_once] == 1) { // here doing insert to mysql } unset($_SESSION[post_only_once]); // remove the session after insert
Popularity: 4,779 views

(4 votes, average: 4.75 out of 5)
One Comment on “How to Protect from double posting insert MySQL”
I dont mean to hijack your forums but I have been looking for work all over the net.There seems to be allot of people here needingsome help and I wanted to drop in and see if I could be of service to anyone.
Like or Dislike:Checkout my resume and let me know if I can help out. http://www.linkedin.com/pub/jason-evans/19/a19/462
Thanks for your Time, Jason