arduino ethernet shield web server

I have this code that locally works perfect, but at the time of sending an external server, does not insert the data, who can help would be appreciated

#include <Ethernet.h>
#include <SPI.h>
#include <SDS011.h>

// Configuracion del Ethernet Shield
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xEE}; // Direccion MAC
byte ip[] = { 192,168,1,101 }; // Direccion IP del Arduino
byte server[] = { 186,64,116,40 }; // Direccion IP del servidor
//byte server[] = { 192,168,1,36 }; // Direccion IP del servidor Externo
byte gw[] = {192, 168, 1, 1};
byte subnet[] = {255, 255, 255, 0};

EthernetClient client;

float p10,p25;
int error;

static const uint8_t D0 = 16;
static const uint8_t D1 = 5;
static const uint8_t D2 = 6;
static const uint8_t D3 = 0;
static const uint8_t D4 = 2;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 15;
static const uint8_t RX = 3;
static const uint8_t TX = 1;

SDS011 my_sds;

void setup(void) {
Ethernet.begin(mac, ip); // Inicializamos el Ethernet Shield
delay(1000); // Esperamos 1 segundo de cortesia

Serial.println("PM10 count,PM2.5 count,PM10 conc,PM2.5 conc");
my_sds.begin(D1,D2);
Serial.begin(9600);
}

void loop(void) {
error = my_sds.read(&p25,&p10);
if (! error) {
Serial.println("P2.5: "+String(p25));
Serial.println("P10: "+String(p10));

// Proceso de envio de muestras al servidor
Serial.println("Connecting...");
if (client.connect(server, 80)>0) { // Conexion con el servidor
client.print("GET /simeco/modelo/rlectura.php?id=4&valor="); // Enviamos los datos por GET
client.print(String(p25));
client.print("&valor2=");
client.print(String(p10));
client.println(" HTTP/1.0");
client.println("User-Agent: Arduino 1.0");
client.println();
Serial.println("Conectado");

}
else {
Serial.println("Fallo en la conexion");
}
if (!client.connected()) {
Serial.println("Disconnected!");
}
client.stop();
client.flush();
delay(10000);
}
}

What do you mean by “but at the time of sending an external server” ?

            client.print(String(p25));

I can assure you that the print() method does not need your ham-fisted "help" to convert a float value to a string. Quit pissing away resources like that.

@nikoko I suggest using DHCP like so. This should set the gateway and DNS IP addresses correctly. And the subnet mask.

Ethernet.begin(mac);

If the gateway IP is wrong, connections to local servers will work but connections to remote servers will fail.

Your program sets the IP address but does not specify the gateway, dns, and subnet so I am not sure what it does. If you must use static configuration, correctly specify the other parameters.