How does Arduino Handle PHP?

I am trying to post data to a MySQL server.
All the examples I can find online are going over my head a bit because they all use PHP and I don't have a great understanding of how Arduino runs PHP scripts.

In this Instructables Example they create a connect.php and add.php file. The add.php file refers to the connect.php.

In the arduino sketch, the add.php is called in this line:

client.println("POST /add.php HTTP/1.1");
  1. How exactly does the add.php run? Does arduino run the code or does it simply pass on the file to the server?

  2. How does arduino know that "add.php" is a file instead of just some text it needs to print?

  3. Do I need to #include the .php files at all? The example does not use any include keywords for the .php files, however, I have seen it used in other examples where .php files are used.

  4. If I write that same line of code in a separate .cpp file and have arduino call the function, would it have the same effect (I will use my own print function of course)? This is important because the 3G module I'm using has all the communication functions in a .cpp file so I'm editing the .cpp file.

  1. The Arduino does not run the php nor does it know/hold/serve the file

  2. It does not know that the printed text refers to any file

  3. No

  4. Yes

Added:

How does Arduino Handle PHP?

It does not handle php in any way.

It can handle the client side only. You must call the php server page with the correct parameters and data.

The "POST /add.php HTTP/1.1" text is parsed by the web server which attempts to find the "add.php" file within the file system on the machine hosting the web server, and then launches the PHP interpreter as a sub-process or thread within the web server.

Essentially it's a way of doing a "remote procedure call". See Remote procedure call - Wikipedia

Thanks everyone for replying, I'm starting to understand it a little better now.

mikb55:
The "POST /add.php HTTP/1.1" text is parsed by the web server which attempts to find the "add.php" file within the file system on the machine hosting the web server, and then launches the PHP interpreter as a sub-process or thread within the web server.

Essentially it's a way of doing a "remote procedure call". See Remote procedure call - Wikipedia

Ohhhhh, so the add.php file should be placed on the server side
That makes so much more sense