IreneLing Posted October 10, 2011 Share Posted October 10, 2011 Hi all , sorry for posting question again , I really tried this for a whole day already but still can't get any solution... Now I completed my submit form with validation , when I click submit , above the form will echo the values entered by user and a button for confirmation , if everything okay then just click the confirm button , it will update into mysql . (I do this using php function ) But even if I click the confirm button , it will just refresh my page and won't update into mysql . I know that it is because this button has no related to the submit form so there is nothing for it to update , but I still don't know how to find other ways to do it . I even tried to put a disabled button first , when I click submit button then it will allow to click . Hmm...not a good way I know...(and won't works with my limited php knowledge) Can I get a little hints for this problem ? In my submit form if(isset($_POST['Submit'])) { if($validator->ValidateForm()) { $myfunction->show_confirmation(); } For the function part: ( another php file ) function show_confirmation(){ echo "Total recipient(s):".count($total)."<br>"; echo "<br>" ; echo "Recipient Number(s):<br>".$_POST['cellphonenumber']."<br>" ; echo "<br>" ; echo "Message:<br>".$_POST['inputtext']."<br>" ; echo "<br>" ; echo "Date:".$_POST['datetime']."<br>" ; echo "<br>"; echo "<br>"; echo " Proceed ?"; echo "<br>"; echo "<form>"; echo "<input type=\"submit\" name=\"Submit2\"> echo "</form>"; if(isset($_POST['Submit2'])) { $this->submit(); } } submit() is just a function that will insert values into mysql table . This is my normal form: After click submit button: So...what should I do to make the Submit2 button works ? Any hints or advices will be greatly appreciate . I'm not asking for a whole complete solution but just some hints...thanks for every reply . Link to comment https://forums.phpfreaks.com/topic/248821-insert-value-into-mysql-after-confirmation/ Share on other sites More sharing options...
sunfighter Posted October 10, 2011 Share Posted October 10, 2011 Some gray areas here. But when you do this: echo "<form>"; echo "<input type=\"submit\" name=\"Submit2\"> echo "</form>"; This is your form. It has nothing in it. and your <form> tag does not have the action to submit this form to. Maybe insert the info above the form into the form. PS. echo "<input type=\"submit\" name=\"Submit2\"> needs an ending " Link to comment https://forums.phpfreaks.com/topic/248821-insert-value-into-mysql-after-confirmation/#findComment-1277971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.