02-28-2008, 10:49 PM
|
#5 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Posts: 87
Thanks: 49
|
I've got another slight problem. Something slightly different. I have the following code:
PHP Code:
if (isset($_POST['submit'])) { //Creating a query that enters the data in the above variables into a DB $query = 'INSERT INTO cart SET pass_cdID = "'.mysql_real_escape_string($pass_cdID).'", pass_artist = "'.mysql_real_escape_string($pass_artist).'", pass_title = "'.mysql_real_escape_string($pass_title).'", pass_price = "'.mysql_real_escape_string($pass_price).'", pass_image_name = "'.mysql_real_escape_string($pass_image_name).'"'; //execcute a query on a MySQL database mysql_query($query); }
Now that query should only be executed if the submit button is pressed on the previous page. It does that, but if you then refresh the page, it runs the query again. Obviously I don't want it to do this, any ideas?
|
|
|
|