I'm trying to use Cloud Firestore on a Wordpress website with PHP. I'm working on a page where users can view and remove data from their account. I have buttons on the website for removing data that are connected to an HTML form. When I click on the buttons, the page redirects to #
and now reflects the new delete. However, when I go back to the original page (without the #
), it shows the old data on the page, even though the data is updated in Firebase Console. This happens even if I open the original page in a new tab.
Here is the HTML form code:
<form action="#" method="post">
<input type="text" name="dataid" value="1" style="display:none">
<input type="submit" value="Remove from list">
</form>
I know the code for removing data works because I can see the data being updated in the Firebase Console. Even after the data is updated, when I open the data management page and run this:
print_r($db -> collection("users") -> document(wp_get_current_user() -> user_email) -> snapshot() -> data());
it prints the old data. Is there a way to prevent my website from getting old data or does anyone know why this might be happening?