I have another little problem in the system that I am developing, summarizing'm trying to insert an HTML page to serve as the most before the main login page of the system, but using the code below which gets the two pages from the SD card it just opens both the same time one over the other did not understand and could not access the login page exit and open the page of the system, using the flag's manually forcing it to enter it opens a condition to a normally researched a lot about the ("Connection: keep-alive"); and ("Connection: close"); but unfortunately without success, any tips?
int flag = 0;
void setup (){
......}
void loop(){
if (flag == 0) {
if (StrContains(HTTP_req, "GET /index")) {
client.println("Content-Type: text/html");
client.println("Connection: keep-alive");
client.println();
}
else { // web page request
// send rest of HTTP header
client.println("Content-Type: text/html");
client.println("Connection: keep-alive");
//client.println("Connection: close");
client.println();
// send web page
webFile = SD.open("index.htm"); // open web page file
if (webFile) {
while(webFile.available()) {
client.write(webFile.read()); // send web page to client
}
webFile.close();
flag = 99;
}
}
}
if (flag ==99){
if (StrContains(HTTP_req, "ajax_inputs")) {
// send rest of HTTP header
client.println("Content-Type: text/xml");
client.println("Connection: keep-alive");
client.println();
SetLEDs();
// send XML file containing input states
XML_response(client);
}
else { // web page request
// send rest of HTTP header
client.println("Content-Type: text/html");
client.println("Connection: keep-alive");
client.println();
// send web page
webFile = SD.open("acesso.htm"); // open web page file
if (webFile) {
while(webFile.available()) {
client.write(webFile.read()); // send web page to client
}
webFile.close();
flag = 0;
}
}
//fim flag
}
.
.
}
<a href="#" onClick="NewWindow=window.open('http://web.comporium.net/~shb/armbat.htm','NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=290,height=270,top=,left=');">Put me in a popup Window</a>