MrBillybob Posted August 18, 2007 Share Posted August 18, 2007 when ever i have an order form if someone presses add cart then presses refresh it will add 2...how do i fix this? Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/ Share on other sites More sharing options...
nathanmaxsonadil Posted August 18, 2007 Share Posted August 18, 2007 you check to see if it's in the database Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327758 Share on other sites More sharing options...
Fadion Posted August 18, 2007 Share Posted August 18, 2007 U could give some more details. Im assuming u have an input and submit in a form. If yes then when hitting refresh, if used post then it will ask to resend the information again and with get it will just run the same url. One idea may be to redirect to the same page just to clear post or get data. Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327763 Share on other sites More sharing options...
MrBillybob Posted August 18, 2007 Author Share Posted August 18, 2007 its a get and i dont want to have to redirect how do i clear the get? Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327765 Share on other sites More sharing options...
nathanmaxsonadil Posted August 18, 2007 Share Posted August 18, 2007 here is where you would check if there is already a entry $doublecheck = "SELECT * FROM table WHERE name = "{$_POST['name']}"; if(mysql_num_rows($doublecheck) == 0){ // put your code to enter into the database here } } Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327766 Share on other sites More sharing options...
MrBillybob Posted August 18, 2007 Author Share Posted August 18, 2007 thx Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327768 Share on other sites More sharing options...
nathanmaxsonadil Posted August 18, 2007 Share Posted August 18, 2007 lol this won't work change this $doublecheck = "SELECT * FROM table WHERE name = "{$_POST['name']}"; if(mysql_num_rows($doublecheck) == 0){ // put your code to enter into the database here } } to $doublecheck = mysql_query("SELECT * FROM table WHERE name = "{$_POST['name']}"); if(mysql_num_rows($doublecheck) == 0){ // put your code to enter into the database here } } Quote Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327774 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.