Jump to content

Updated Data Not Shown on PHP Page But the MySQL DB Is Updated


Alans

Recommended Posts

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 by Alans
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.