I\'m trying to run a quick php script when users leave my website, and also pass a variable from my javascript to php but i\'m not quite sure how to include the php file and
Make an ajax call to scripts/RemoveUserOnDisconnect.php?username=username. You cannot include PHP with Javascript, Javascript executes on the browser, PHP executes on the server..