Jump to content

multiple form submittion


CanMan2004

Recommended Posts

Hi

I have a php form which sends data to a sql database, I perform the sql query with a $_GET action

The form does a GET and posts the data in the URL like

register.php?action=add&name=dave&department=2

the php code I then use is

[code]if ($_GET['action'] == 'add')
{
INSERT INTO .........
}[/code]

Once the INSERT is done, the user is directed to another page, the problem is that because the form method is set to GET, when the user clicks the back button, the GET action and data that was sent from the form is in the URL and the form data is submitted again.

Is there a way to distroy the GET data from the form or know if a user has clicked the back button.

Any help would be great

Thanks in advance

Dave
Link to comment
https://forums.phpfreaks.com/topic/19474-multiple-form-submittion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.