ncurran217 Posted December 27, 2012 Share Posted December 27, 2012 Right now I have a page with a form and when you hit the submit button it then, that goes to my php page that has all the SQL Server post commands and inserts all the information typed into the form into the database. When all the information is entered into the database there is another column that auto-increments for a Reference Number. I want to have that Reference Number popup on the screen after the user hits Submit on the form page, but not sure how to go about this. Please let me know if I need to explain more. Thanks in advance for the help! Quote Link to comment https://forums.phpfreaks.com/topic/272415-submitting-form-with-popup-with-reference-number/ Share on other sites More sharing options...
lemmin Posted December 27, 2012 Share Posted December 27, 2012 mysql_insert_id() (or mysqli_insert_id()) will get you that reference number of the inserted row. Is that what you are asking? Quote Link to comment https://forums.phpfreaks.com/topic/272415-submitting-form-with-popup-with-reference-number/#findComment-1401578 Share on other sites More sharing options...
ncurran217 Posted December 27, 2012 Author Share Posted December 27, 2012 (edited) I am not sure what that does, as I am using SQL Server not mysql. But when they hit the submit button the form, I want a box to popup with the reference number column that is in the database, hopefully that clears it up. Edited December 27, 2012 by ncurran217 Quote Link to comment https://forums.phpfreaks.com/topic/272415-submitting-form-with-popup-with-reference-number/#findComment-1401580 Share on other sites More sharing options...
lemmin Posted December 27, 2012 Share Posted December 27, 2012 If you are not asking how to get the reference number, are you asking how to send the reference number to the user? There are so many steps in this that you could be asking about! Have you made any attempts to accomplish this that have yielded code you could show us? If you simply want a box to popup with the reference number, print some Javascript to the action page that includes window.open() and pass the reference number into document.write() along with whatever other text you want. If you don't want to change the page, you can still do this by attaching the javascript to an AJAX call that would request the reference number. Let me know more specifically what you are having trouble with and I can give you some examples. Quote Link to comment https://forums.phpfreaks.com/topic/272415-submitting-form-with-popup-with-reference-number/#findComment-1401586 Share on other sites More sharing options...
ncurran217 Posted December 27, 2012 Author Share Posted December 27, 2012 Ok, well that gives me a start on how I would accomplish this. Quote Link to comment https://forums.phpfreaks.com/topic/272415-submitting-form-with-popup-with-reference-number/#findComment-1401602 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.