Retrieve data from website.

How can i get this php page data . and retrieve to arduino using textfinder ?

php.PNG

void getPumpTimer(){

DateTime now = RTC.now();

int year2 = now.year(); int month2 = now.month(); int day2 = now.day(); int hour2 = now.hour(); int minute2 = now.minute();

Timer = "year:" + String(year2) +"month:" + String(month2) +"day:" + String(day2) +"hour:" + String(hour2) +":minute:" + String(minute2) ;

const char* host = "plantwatering.000webhostapp.com";

if (client.connect(host, 80)) {

// Make a HTTP request: client.println("GET /getTimer.php? HTTP/1.1"); client.println("Host: plantwatering.000webhostapp.com"); client.println("Connection: close"); client.println(); Serial.println("connected"); unsigned long timeout = millis(); while (client.available() == 0) { if (millis() - timeout > 5000) { Serial.println(">>> Client Timeout !"); client.stop(); return; } }

} if (client.available()) { if(client.find(Timer)){ Serial.println("find") }

}

client.stop(); }

  if(client.find(Timer)){
    Serial.println("find")
  }

Personally, I find it pointless to assume that the server will return a specific, complex string. The FIRST step, when dealing with a new server is to JUST print what it returns. Then, you can consider what to save and how to parse what you save.