karthikjayraj Posted October 22, 2010 Share Posted October 22, 2010 Hi, I have set up 2 php pages page 1 - add_entry2.php In this page I have a invoice table created where I can dynamically add/delete rows. This has a View Bill button which takes me to page 2- add_entry3.php In this page it shows up the rows added in page 1 in read only format, so if the user wants to modify the data that he/she entered then he must Click on <back> that i have provided in the page 2 which will direct him to page 1 Now the problem starts here on click of Back the dynamically added rows dissappear..which is frustrating..I know its something to do with my code..but can anyone help me fix it. One more thing is that i dont want to store the data into DB till the finalise button is clicked on page 2 so that means till page 2 is submitted nothing goes to DB from Page 1. I am able to retain values if I use the code <form action="add_entry2.php" name="eval_edit" method="post" format="html"> i,e if I submit back to the same page and retrieve values form $_POST but If I use the code <input type="button" value="Back" onClick="history.go(-1);return true;"> to get back to add_entry2.ph it looses all the values. Is there any other way to code the BACK link retaining my $_POST values(Do you think $_SESSION would work in this case?) Quote Link to comment https://forums.phpfreaks.com/topic/216527-code-back-button-to-retain-values-from-_post/ Share on other sites More sharing options...
savagenoob Posted October 22, 2010 Share Posted October 22, 2010 If I am correct there is a problem caching in IE with POST, need to use GET and it will retain data. Quote Link to comment https://forums.phpfreaks.com/topic/216527-code-back-button-to-retain-values-from-_post/#findComment-1125103 Share on other sites More sharing options...
karthikjayraj Posted October 24, 2010 Author Share Posted October 24, 2010 Thanks nothing worked....I had to drop the option of going BACK :'( Quote Link to comment https://forums.phpfreaks.com/topic/216527-code-back-button-to-retain-values-from-_post/#findComment-1125999 Share on other sites More sharing options...
phpfreak Posted October 25, 2010 Share Posted October 25, 2010 The best way to do this would be to code your Back Button to the form post page and make it another form... post those fields as <input type="hidden" name="fieldname" value="posted_value" /> then post the submitted values back to the form and populate the fields based on the original information submitted. IE sucks - and this is one reason why - many of us PHP developers wish IE was never created... Quote Link to comment https://forums.phpfreaks.com/topic/216527-code-back-button-to-retain-values-from-_post/#findComment-1126007 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.