Go Down

Topic: What connection? (Read 662 times) previous topic - next topic

cantore

I think an easy way is to use get or post. Act in this way:

Code: [Select]

client.print("GET /nomeScript.php?var1=");            // send this to apache on server to call the script "nomeScript.php"
      client.print(var1);
      client.println(" HTTP/1.1");                  //
      //Serial.println(" HTTP/1.1");                  //
      client.println("Host: www.myHost.com");    //
      //Serial.println("Host: www.myHost.com");    //
      client.println("User-Agent: Arduino");        // ethernet related stuff
      //Serial.println("User-Agent: Arduino");        //
      client.println("Accept: text/html");          //
      //Serial.println("Accept: text/html");          //
      //client.println("Connection: close");        //
      //Serial.println("Connection: close");        //
      client.println();                             //
      Serial.println();





After on a php srcipt you can save the variable in a text file or in a database as you need.

draythomp

cantore's technique is exactly what I use as well.  If you want to send several values just separate each of them with a comma from the last one and then the server can parse them out.
Trying to keep my house under control http://www.desert-home.com/

Go Up