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? 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 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. 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? 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 } } 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 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 } } Link to comment https://forums.phpfreaks.com/topic/65632-solved-order-form/#findComment-327774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.