Simple PHP Page


I just created a simple PHP page to store the values into the sql database, but for some reason my Spark won’t send the data, I just created this simple code to make sure the Core can post it, but no luck. My php file works good because if I go on the browser and type this address with any values like this:
it will store it in the database, but when I try with the core, nothing.
Can someone help what can possibly be? here is the code I wrote on the Core,
Thank You.

// This #include statement was automatically added by the Spark IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"

// This #include statement was automatically added by the Spark IDE.
#include "HttpClient/HttpClient.h"

TCPClient client;
char server[] = "";

void setup()

void loop()
    Serial.println("Hello Computer");
    if (client.connect(server, 80)) {
    client.println("GET /Sensor/ReceiveDataFromSparkCore.php?Name=Test&Temperature=90&Humidity=50&Value1=1&Value2=200&Value3=1 HTTP/1.1");
    client.println("Host: ");
    client.println("Connection: close");

  else {
    // Serial.println("Connection failed");
    // Serial.println("Disconnecting.");

I’ve edited your post to properly format the code. Please check out this post, so you know how to do this yourself in the future. Thanks in advance! ~Jordy


Instead of trying to send the data to your server, go to and create a bin (for free), they will give you a URL. Try using the Spark to send to that URL. It will show you what the request looks like coming out from the core. You could do the same URL in your browser to see what your browser is sending. Then you can see what difference there is between what the Core sends and what the Browser sends, and from there figure out what is wrong.