php - how to automate a button html -
so have written html code create webpage , after reading rfid tag. page creates button on webpage must clicked in order upload data sql database.
how make automatic when tag read automatically upload tag data without asking user click upload button?
i trying use <meta http-equiv=”refresh” content=”5" />
function unsure put in code
an please? how remove 'upload code' button automate process , refresh page each time tag read
void loop() { // check if client has connected client = server.available(); if (!client) { return; } // wait until user sends data serial.println("new user"); while (!client.available()) { delay(1); } //wait serial data available i.e. because tag has been scanned if(serial.available()) { //read serial port , store data in char array serial.println("data available"); (int i=0;i<15;i++) { val = serial.read(); valarray[i] = val; yield(); //delay(10) } serial.print(valarray); // write client client.println("<!doctype html>"); client.println("<html>"); client.println("<head>"); client.println("<title>esp8266 demo</title>"); client.println("</head>"); client.println("<body>"); client.println("<a href=\"/\">refresh status</a>"); client.println("</br></br>"); string strlink1 = "<a href='http://xxxxxxxx.com/track.php?rfid="; string strlink2 = "'>upload tag id</a>"; string strlink = strlink1 + valarray + strlink2; client.println(strlink); client.println("</br></br>"); client.print("rfid tag no = "); client.print(valarray); client.println("</br>"); client.println("</body>"); client.println("</html>"); } //client.stop(); delay(100);
}
you try inserting below button:
<script>document.getelementsbytagname("a")[1].click();</script>
or equivalent ran when needed, i'm not clear on when of it.
Comments
Post a Comment