how to make a php script so that the website says whether the user is online or offline
Take a look in here: WebQuery discussion/help (3.12.0 onwards)
You can use the WebQuery API to send requests to your TeamSpeak server with PHP.
- request the client list with the serverquery command
- request the client details for each client ID with
- search for the client UID or myTeamSpeak ID for example to identify the client you’re searching for
- if he’s found in the list he’s of course online and if not offline
You can save his last status in a file or database for example to ensure fast response timings if someone reloads your website.
You will have to set up a task/cronjob to run this script every X time, for example each minute.
Details about the API can found in the mentioned thread.
Details for the mentioned commands can be found in the serverquery documentation.