HTML executar comando

Good morning everyone
I have the program working, but every time I click the button it opens a window. Is it possible to run the link without having to open / change pages?

Bom dia a todos
Eu tenho o programa a funcionar, só que cada vez que clico no botão abre uma aba/janela. A questão é possível executar o link sem que seja preciso abrir/mudar de pagina?

#include <ESP8266WiFi.h>
const char* ssid = “RedeCasa”;
const char* password = “RedeCasa5533”;
IPAddress ip(192,168,0,192);
IPAddress gateway(192,168,0,254);
IPAddress subnet(255,255,255,0);
WiFiServer server(80);
String inString = String(35);

void setup(void) {
// Serial.begin(115200);
// Connect to WiFi network
/* Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid); */

WiFi.begin(ssid, password);
WiFi.config(ip, gateway, subnet);// Ip manual

/* while (WiFi.status() != WL_CONNECTED) {
Serial.println(“WiFi connected”);
Serial.println(WiFi.localIP()); */

// Start the server
// Print the IP address

void loop(void) {
// Check if a client has connected
WiFiClient client = server.available();
if (client) {
boolean current_line_is_blank = true;
while (client.connected()) {

if (client.available()) {

char c =;

if (inString.length() < 35)
if (c == ‘\n’ && current_line_is_blank)
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-Type: text/html”);
/************************** Pagina em HTML ****************/
client.print(“Casa Teste”);

// *************************************************************** Esta correcto
//********************** Estores Cozinha Pequeno

Estoro Cozinha Pequeno <a href= target=_blank”>Abrir");
client.print(" <a href= target=_blank">Parar");
client.print(" <a href= target=_blank">Descer");
// *************************************************************** fim Esta correcto

client.println("<a href="/subir=Subir">ON");

if (inString.indexOf("/subir=Subir") != -1)
// Objecti é executar sem abrir uma aba

if (c == ‘\n’)
// we’re starting a new line
current_line_is_blank = true;
} else if (c != ‘\r’)
// we’ve gotten a character on the current line
current_line_is_blank = false;
// give the web browser time to receive the data
inString = “”;

remove all target=_blank from your code


My webserver is
IPAddress ip(192,168,0,192);
IPAddress gateway(192,168,0,254);
I remove “target=_blank” but change page for

Objective is execute but stay the same page

Objective is execute but stay the same page

That does not make sense. Your browser makes a GET request, to, containing some data - subir=Subir. It doesn't make sense to talk about executing that. In any case, regardless of what the client (browser) requests, you make the same reply. That does NOT change the page that the browser displays. The address bar shows that the browser made a request, and got a response.

If you want the address bar to show something different, you MUST stop generating the same f**king reply for every request.

kammysammy: My webserver is IPAddress ip(192,168,0,192); IPAddress gateway(192,168,0,254); I remove "target=_blank" but change page for

Objective is execute but stay the same page

subir=Subir in your URL makes no sense unless you actually have a [u]subdirectory[/u] named subir=Subir (which I am not sure is legal).


Thanks for the answers I'm going to change a serial communication, it seems easier.