Controlling Arduino from the remote server?

Hello. I need some helps for the following the scenario.

  1. I create a web home page.
  2. My friend opens the web page using a browser.
  3. There is a button. If the button is pressed, it will check if an Arduino is connected to my friend's PC or not.

How do I approach this scenario? How does the server know that the Arduino is connected to the remote PC?
Is there any source or material for the purpose or similar story?

Thanks. I appreciate it.

  1. I create a web home page.

Hosted where?

  1. My friend opens the web page using a browser.

OK.

  1. There is a button. If the button is pressed, it will check if an Arduino is connected to my friend's PC or not.

What will? If the button is a submit button, the action field for the form defines what script, on what server, is executed. Where is that script located?

How will the server hosting that script know anything about what is attached to a client's computer?