PHP by it self can do nothing in this case. Web servers and browsers are stateless. They know nothing about what happened before or what will happen in the future. Once a form has been sent from a web server to a client and rendered in a browser, there is no connection between the server and the browser.
Ah, it's just clicked. I reread what you are trying to achieve.
I think dbmab could be right. What you need is a function call every time someone clicks on another link in your website to check whether the information has been posted/saved already.