Executing a php script in javascript?

后端 未结 3 2105
南旧
南旧 2021-01-17 05:23

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

3条回答
  •  甜味超标
    2021-01-17 06:07

    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..

提交回复
热议问题