How receiving data from web (php/mysql) to wemos?

hello, i know it is a bit difernt than ther post because i am asking about another device beside arduino.

i am working on my project and trying make a doorlock using Wemos d1 r2 for microcontroller (based esp8266 for wifi communication between device and internet), and my own hosting. i am gong to make an iot project with my phone also to send the command.

i was succed to do this but only using a thinkspeak for database and analize the respon input from smartphone, however i want to try it with my own hosting … i am confuse how to do so and ths is a cod i have for my suced project;

#include <ESP8266WiFi.h>
#include <ThingSpeak.h>

#define RELAY1 D3 //
//#define RELAY D0

// replace with your channel’s thingspeak API key and your SSID and password
String apiKey = “thingspeak api key”;
const char* ssid = “Connectify-cat”; //connectify me
const char* password = “12345678”; //connectify me
const char* server = “api.thingspeak.com”; //konek ke thingspeak // api nya di sini

WiFiClient client;

void setup()
{
pinMode (RELAY1, OUTPUT); //relay sebagai output
Serial.begin(115200);
delay(10);

Serial.println();
Serial.println();
Serial.println("------------------------------------");
Serial.println("Connecting to : ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED)
{
delay(500);
//Serial.print(".");
}

Serial.println("");
Serial.println(“WiFi connected”);
Serial.println("------------------------------------");

ThingSpeak.begin(client);
}

void loop()
{

if (client.connect(server,80)) { //connect ke server

/*String postStr = apiKey; //begin untuk kirim data ke thingspeak
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h); //input perintah
postStr += “\r\n\r\n”;

client.print(“POST /update HTTP/1.1\n”);
client.print(“Host: api.thingspeak.com\n”);
client.print(“Connection: close\n”);
client.print(“X-THINGSPEAKAPIKEY: “+apiKey+”\n”);
client.print(“Content-Type: application/x-www-form-urlencoded\n”);
client.print(“Content-Length: “);
client.print(postStr.length());
client.print(”\n\n”);
client.print(postStr);

Serial.print("Data: ");
Serial.print(“1”);

Serial.println(“Sending data to Thingspeak”);
} //end sending data ke thingspeak
*/

//get data -------------------------------------------------------------------------------------

float door = ThingSpeak.readFloatField(“channelthingspeak”, 1, “apikeythingspeak”); //baca channel, field dan apikey R atau W
Serial.print(“keadaan :”);
Serial.println(door);

//Relay control --------------------------------------------------------
if(door ==0){
digitalWrite(RELAY1,HIGH);
Serial.println(“OFF”);
}
else if (door ==1){
digitalWrite(RELAY1,LOW);
Serial.println(“ON”);
}
}
else{
Serial.println(“LOST CONNECTION”);
}
//----------------------------------------------------------------------------------------------

client.stop();

Serial.println(“Waiting 20 secs”);
// thingspeak needs at least a 15 sec delay between updates
// 20 seconds to be safe
delay(500);
Serial.println("-------------------------------------------");
}

i am kind of newi and i really appreciate for those who know and help me more, thank you.