Server unable to respond to GET request from NodeMCU

Not sure if this is a right place to post this. And I tried my best with the subject’s title. I’m doing some IOT rfid project. It require the hardware(circuit consisting of NodeMCU, RFID reader,…) to access the server to verify the rfid card. If the card is valid(UID registered in the server), it’ll proceed to the next instruction. If the card invalid, server will automatically register the UID. Every time the GET request is sent, the hardware will wait for the server’s response(in this case, an echo from php file in the server). NodeMCU will read the response from server until it found the ‘marker’. My problem is, it seem that the server unable to response to the GET request. I don’t know how to explain this with word but here is my code for NodeMCU.

//sending GET request to the server
//return value after find response
//serial read using start marker and end marker

boolean verifyCard(String uid){
  // Create a URL for the request. Modify YOUR_HOST_DIRECTORY so that you're pointing to the PHP file.
  String url = "/myserver/client/terminal_verify.php?uid=";
  url += uid;
  String r = (readUntilEndMarker(url));
  Serial.println();
  Serial.print("Response from server: ");
  Serial.println(r);
  if(r.equals("Valid")){
    return true;
  }else{
    return false;
  }
}

boolean registerUID(String uid){
  // Create a URL for the request. Modify YOUR_HOST_DIRECTORY so that you're pointing to the PHP file.
  String url = "/myserver/client/terminal_reg.php?uid=";
  url += uid;
  String p = (readUntilEndMarker(url));
  Serial.println();
  Serial.print("Response from server: ");
  Serial.println(p);
  if(p.equals("UID registered")){
    return true;
  }else{
    return false; 
  }
}

int processAccess(String uid, String buy, String pin){
  // Create a URL for the request. Modify YOUR_HOST_DIRECTORY so that you're pointing to the PHP file.
  String url = "/myserver/client/terminal_access.php?uid=";
  url += uid;
  url += "&pin=";
  url += pin;
  String q = (readUntilEndMarker(url));
  Serial.println();
  Serial.print("Response from server: ");
  Serial.println(q);
  if(q.equals("Access granted")){
    return 1;
  }else{
    return 2;
  }
}

////////////////////////////////READ FROM START MARKER UNTIL END MARKER///////////////////////////////////
String readUntilEndMarker(String url){
  static boolean recvInProgress = false;
  static byte ndx = 0;
  char startMarker = '<';
  char endMarker = '>';
  char rc;
  String res = "";
  
  // This will send the request to the server
  Serial.print("Requesting URL: ");
  Serial.println(url);
  Serial.println("Please wait...");
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Connection: Close\r\n\r\n");
     
  unsigned long timeout = millis();
  
  while (client.available() == 0) {
    if (millis() - timeout > 10000) {  //if after 10 sec client still not available
      Serial.println(">>> Client Timeout !");
      client.stop();
      break;
    }
    yield();
  }

  // Read all the lines of the reply from server and print them to Serial
  while (client.available() > 0 && newData == false){
    rc = client.read();
    Serial.print(rc);
    if(recvInProgress == true){
      if(rc!=endMarker){
        receivedChars[ndx] = rc;
        Serial.print(receivedChars);
        ndx++;
        if(ndx >= numChars){
          ndx = numChars - 1;
        }
      }else{
        receivedChars[ndx] = '\0';
        recvInProgress = false;
        ndx = 0;
        newData = true;
      }
    }
    else if(rc == startMarker){
      recvInProgress = true;
    }
    yield();
  }
  client.stop();

  if(newData == true){
    res = String(receivedChars);
    newData = false;
  }
  return res;
}

Here is my php files to verify the card:

<?php
	include_once("config/config.php");
	
	$uid = mysqli_real_escape_string($dbc, $_GET['uid']);

	$sql1 = "SELECT * FROM users WHERE uid = '$uid'";
	$res = mysqli_query($dbc, $sql1);

	if(mysqli_num_rows($res)==1){
		echo "<Valid>";
	}else{
		echo "<Invalid>";
	}
?>

Here is my php file to register the card:

<?php
	include_once("config/config.php");

	$flag = "temp";
	
	//from hardware
	$uid = mysqli_real_escape_string($dbc, $_GET['uid']);
	
	//update table that store user's uid 
	$sql = "UPDATE reader SET uid = '$uid' WHERE flag = '$flag'";
	if(mysqli_query($dbc, $sql)){
		echo "<UID registered>";
	}else{
		echo "<Failed>";
	}
?>

Registering the card is completed using web app. This php file is only updating the value into the web app form. Still, it should update the ‘reader’ table and echo ‘UID registered’. But what I get from the serial monitor is:

Connecting to 192.168.43.188
Connected to host

Waiting for card

UID tag : 20 E0 19 A4
New UID= 20E019A4
Requesting URL: /myserver/client/terminal_verify.php?uid=20E019A4
Please wait...
HTTP/1.1 200 OK
Date: Sat, 05 May 2018 06:20:00 GMT
Server: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7
X-Powered-By: PHP/7.1.7
Content-Length: 1168
Connection: close
Content-Type: text/html; charset=UTF-8

<bbrbr br /br />
Response from server: br /
Invalid Card
Auto registeration

Connecting to 192.168.43.188
Connected to host
Requesting URL: /myserver/client/terminal_reg.php?uid=20E019A4
Please wait...
HTTP/1.1 200 OK
Date: Sat, 05 May 2018 06:20:03 GMT
Server: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7
X-Powered-By: PHP/7.1.7
Content-Length: 977
Connection: close
Content-Type: text/html; charset=UTF-8

<bbr /rbr / br //br />
Response from server: br /
Failed to register

Connecting to 192.168.43.188
Connected to host

Waiting for card

The response from server should be the echoed string from the php file. I also tried changing the timeout but no luck. And I’m using xampp. Really need help.

P.S: I’m doing the same thing a few week ago and everything works fine. Perhaps I messed around with the code after that but I don’t really remember. As far as I remember, this problem occurs after I moving from breadboard to the stripped circuit board.

have you tried using wireshark to monitor network traffic and check that the information in the packet is correct?