Refresh the original page when a user presses back button (after registration) to navigate to previous page

31
February 11, 2019, at 5:10 PM

Need Help!

PhP developers and WordPress experts, need your help in a logic.

I am building a Woocommerce website for a client of mine and I have created a custom register form to register a user as wholeseller. Once a user registers as wholeseller, he is taken to the login form automatically where he can then press a button to go back to the page where he originally landed from a source.

Note: I am showing different prices to wholeseller.

The problem I am facing is when the user presses the back button, I am using the onclick method of javascript:

onclick="window.history.go(-1); return false;

But, the problem is when a user presses the back button, the user is navigated back to original page but, the page is loaded from history.

Instead, what i need is the page is reloaded when the use is navigated back so, the logged in wholeseller sees the new updated priced i have set for wholeseller.

Need help in the creation of logic so that the original page is refreshed when i press the back button on the login page.

onclick="window.history.go(-2); return false;

I am using this on button but, it only goes back to original page by loading it from cache and doesn't refresh it to show new prices

I need the page (where user originally landed) to be refreshed when the user has registered and has been logged in and wants to get back to original product to view the updated prices set for wholeseller

Answer 1

You might be looking for : PHP Header

Use it directly after the user registration if it didn't fail.

READ ALSO
How to redirect users to their specific subfolders?

How to redirect users to their specific subfolders?

Ok, so I tried to Google it, make it by myself, but I just messed up my website, so after days of trying, I'm here to ask

57
How to use chr() function in an array for cleaning strings from dangereous characters in PHP?

How to use chr() function in an array for cleaning strings from dangereous characters in PHP?

Hi everyone i was working on some php formsI am a newbie so i might used a really annoying way to solve my problem

40
Show concrete data of array with objects [duplicate]

Show concrete data of array with objects [duplicate]

This question already has an answer here:

43