Alans Posted August 25, 2022 Share Posted August 25, 2022 I added SSL to my website and now data entered in a php form is not being refreshed after saving even though I see the data was updated in the MySQL database Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/ Share on other sites More sharing options...
mac_gyver Posted August 25, 2022 Share Posted August 25, 2022 cannot possibly help you without having all the code needed to reproduce the problem. i'm going to guess session data is involved and you are switching between http and https requests, which will result in two separate sessions. 1 Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599846 Share on other sites More sharing options...
Alans Posted August 25, 2022 Author Share Posted August 25, 2022 From what I can tell all are using https. Baring giving you all of my code and assuming it is a sessions problem are you able to suggest any possible solutions or things I can try? Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599847 Share on other sites More sharing options...
Alans Posted August 26, 2022 Author Share Posted August 26, 2022 (edited) Just in case this is useful, here is the overview of the process I am using going back and forth between two php pages: First I launch the starting page with this https://<domain name>/<directory 1>/<directory 2>/<php edit page>?lv_action=U Then I send my updates with a Submit button using this echo "<form name='<form1>' action='<php dml processing page>' method='POST'>"; Then I go back to the initial page with echo "function GoBack()"; echo "{ "; echo " location.href='<php edit page>?lv_action=U'"; echo "}"; echo "<body link='#000000' vlink='#000000' alink='#000000' onLoad='GoBack()'>"; The <php edit page> is displayed, however, the updated data is not displayed on the form but is updated in the database Edited August 26, 2022 by Alans Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599848 Share on other sites More sharing options...
mac_gyver Posted August 26, 2022 Share Posted August 26, 2022 is your code even using session variables? at this point, you are the only person here who knows specifically what your code requires for it to produce the correct output. we could offer a dozen different guesses, but your code could be doing a 13th or 14th... thing that no one thought to mention because they could not see what your code is dependent upon for it to work. the only thing i can recommend based on the non-specific information provided is you need to put your form and form processing code on the same page so that the code is easier to secure, provides a good user experience, is simple, and has a better chance of working or telling you why it doesn't. the only redirect you should have is upon successful completion of the post method form processing code and it should be to the exact same url of the current page to cause a get request for that page, so that the browser won't attempt to resubmit the form data. Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599863 Share on other sites More sharing options...
Alans Posted August 26, 2022 Author Share Posted August 26, 2022 My form and process to insert/update the database work just fine. I have confirmed that several times. I do not understand why the refresh of both the form edit page, and a second page that just displays the data, which retrieves the data from the database every time the page is accessed or refreshed would not show the current data confirmed to be in the database. Also puzzling is that the data does show up on my display page even when it is added to the database with the phpMyAdmin application in cPanel. thanks Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599866 Share on other sites More sharing options...
Alans Posted August 26, 2022 Author Share Posted August 26, 2022 Correction, in the last sentence it should say .. does NOT show up ... Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599872 Share on other sites More sharing options...
gizmola Posted August 29, 2022 Share Posted August 29, 2022 You need to provide some code for people to look at. Quote Link to comment https://forums.phpfreaks.com/topic/315239-updated-data-not-shown-on-php-page-but-the-mysql-db-is-updated/#findComment-1599902 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.