I guess this is difficult to do in php
You could write a javascript function that validates the form (or checks if the save button was clicked) before redirecting to the link that the user clicked on.
Why don't you just make a popup window where the user can edit his/her profile that cannot be closed/lose focus except when he/she clicks the save button? This will force the user to submit the form before returning to your site and click on links...
To keep a window focussed:
<script language="JavaScript"><!--
function keepFocused() {
self.focus();
setTimeout('keepFocused()',100);
}
keepFocused();
//--></script>
Your submit button would look like this:
<input type="submit" value="Save Profile" name="Submit" onClick="javascript:window.close()">