PHP is server side, not client side.
btw: why do you want to prevent that? If the user wants to click in the menu to load the page wich is allready loaded, let him. It's not like its gonna kill him or something
Don't make things that aren't really neccesary.
The more code you make, the more errors there are in you're code.