How to get the value of gps module expecially longitude and latitude and display to the web using Nodemcu ESP8266

This is the code for GPS module using Nodemcu Esp8266 (Access Point)

        #include <ESP8266WiFi.h>
        #include <WiFiClient.h> 
        #include <ESP8266WebServer.h>
        #include <TinyGPS++.h>
        #include <SoftwareSerial.h>
        const char* host = "GPS_NodeMCU";
        const char* ssid = "GPS_BOT";
        String latitude, longitude;
      #define RXPIN 4
#define TXPIN 5
SoftwareSerial ss(RXPIN, TXPIN); // The serial connection to the GPS device
        ESP8266WebServer server(80);
        TinyGPSPlus gps;
        void setup() {
          Serial.begin(115200);
        // Connecting WiFi

         WiFi.mode(WIFI_AP);
          WiFi.softAP(ssid);
        // Starting WEB-server
         server.on ( "/", HTTP_handleRoot );
         server.onNotFound ( HTTP_handleRoot );
         server.begin();    
        }
        void loop() {
          server.handleClient();
           delay(50);
           while (ss.available() > 0){
            gps.encode(ss.read());
            if (gps.location.isUpdated()){

         latitude = "Latitude = " +(gps.location.lat(), 6);

           longitude = "Longitude = " +(gps.location.lng(), 6);
            }
          }
        }
        void HTTP_handleRoot(void) {
          server.send(200, "text/plain", latitude + "," + longitude);

        if( server.hasArg("State") ){
           Serial.println(server.arg("State"));
          }
          server.send(200,"text/html","" );
        }

But my output is

How to get the value of latitude and longitude using a GPS module and display to the web. But in my case I can’t display the value. What I did wrong in my code?

Maybe your local network is 192.168.1.X and the ESP8266 network 192.168.4.X. Different networks.

But sir they are the same network.

Does this code work for you?
#include <ESP8266WiFi.h>

const char *ssid = "ESP8266_RED";
//const char *password = "123456789";
 
IPAddress ip(192, 168, 4, 2);
IPAddress gateway(192, 168, 4, 1);
IPAddress subnet(255, 255, 255, 0);

WiFiServer server(80);
int random_number = 1;
void setup()
{
   Serial.begin(115200);
   delay(10);
   Serial.println();
 
   WiFi.softAP(ssid);
   WiFi.softAPConfig(ip, gateway, subnet);
   Serial.print("Iniciado AP:\t");
   Serial.println(ssid);
 
   Serial.print("IP address:\t");
   Serial.println(WiFi.softAPIP());
   
   server.begin();
}
 
void loop() {
  random_number=random(1,100);
   // Consulta si se ha conectado algún cliente.
  WiFiClient client = server.available();
  if (!client) {
return;
  }

  Serial.print("Nuevo cliente: ");
  Serial.println(client.remoteIP());

  // Espera hasta que el cliente envíe datos.
  while(!client.available()){ delay(1); }


  
  //////////////////////////////////////////////
  // Página WEB. ////////////////////////////
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println(""); //  Importante.
  client.println("Aleatorio: ");
  client.println(random_number);
  Serial.print("Cliente desconectado: ");
  Serial.println(client.remoteIP());
  client.flush();
  client.stop();
  
  }

There is two thing that can cause this.

  1. The latitude and longitude string is empty for some reason(gps code, gps connection...).
  2. If i 'm not mistaken, then the send method is not happy if you use other than a simple variable name, but not sure.
    Try to make the final string before the send and send that.
    Like:

string message = latitude + "," + longitude;
server.send(200, "text/plain", message);