Jump to content

AJITnayak

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by AJITnayak

  1. Dear all. http://arduino.cc/en/Tutorial/WebServer Here i am attaching Link for Understanding. I wanted To Create some tag which can talk to controller using Web server application. Intially i am new bie to web server application. From Forum i could able to create tag : For example: I want to Crete user name and password in Web server application.Explained here http://www.w3schools.com/html/html_forms.asp Now user can capable of see use rname and password: Question : Now user enter user name and password . Now how to check user name and password valid or not. ?? 2) i want to create customize tag for example: User profile contains Name: Dob profession Edit option: Edit profile edit password edit system parameter Each followed by Ok, SAVE, Cancel option How to create and interlink
  2. Dear all, I am learner in HTML coding. I am developing code on webserver application. Here what i wanna try todo. Initially i wanna enter username and password . Once Username and password is entered . and perform add operation. Is any software where i can create tags of my own and HTml code generated intenally and for username and password i can put test conditions #include <SPI.h>#include <Ethernet.h>// Enter a MAC address and IP address for your controller below.// The IP address will be dependent on your local network:byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };IPAddress ip(192,168,1,128);// Initialize the Ethernet server library// with the IP address and port you want to use // (port 80 is default for HTTP):EthernetServer server(80);void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); Serial.print("server is at "); Serial.println(Ethernet.localIP());}void loop() { // listen for incoming clients EthernetClient client = server.available(); if (client) { Serial.println("new client"); // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); Serial.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == 'n' && currentLineIsBlank) {client.println("<!DOCTYPE html>"); client.println("<html>"); client.println("<body>"); client.println("<form action=='demo_form.asp'> Birthday: <input type='date' name='bday'> <input type='submit'>"); client.println("<form>"); client.println("</form>"); client.println("USER name:<input type='text' name='firstname'><br>"); client.println("PASSWORD:<input type='password' name='pwd'><br>"); client.println("</form>"); client.println("<body>"); client.println("</html>"); break; } if (c == 'n') { // you're starting a new line currentLineIsBlank = true; } else if (c != 'r') { // you've gotten a character on the current line currentLineIsBlank = false; } } } // give the web browser time to receive the data delay(1); // close the connection: client.stop(); Serial.println("client disonnected"); }}
  3. #include <SPI.h>#include <Ethernet.h>byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };byte ip[] = { 192, 168,1, 120 }; EthernetServer server(80);float latitude=13.08;float longitude=80.20;void setup(){ Serial.begin(9600); Ethernet.begin(mac, ip); server.begin();}void loop(){ Ethernet_Control();}void Ethernet_Control(){ EthernetClient client = server.available(); // detect if current is the first line boolean current_line_is_first = true; if (client) { // an http request ends with a blank line boolean current_line_is_blank = true; while (client.connected()) { if (client.available()) { char c = client.read(); if (c == 'n' && current_line_is_blank) { client.println(F("HTTP/1.1 200 OK")); client.println(F("Content-Type: text/html")); client.println(); client.println(F("<META HTTP-EQUIV=REFRESH CONTENT=5 URL=>")); client.println(F("<center><p><h5>Web application V1.0</h5></p><center><hr><br />")); client.print(F("<p><h5>DATE: = <font color=indigo>")); client.print(" <font> <color=blue> latitude: <input type=text name=01 value="); client.println(latitude); client.print(" <font> <color=black> Longitude: <input type=text name=01 value="); client.println(longitude); client.println("</form>"); client.println("</body>"); client.println("</html>"); client.println("<p>NOTE: This page will automatically refresh every 5 seconds.</p></center>"); break; } if (c == 'n') { // we're starting a new line current_line_is_first = false; 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 delay(1); client.stop(); }} Dear all. Here is my code. I am using Arduino as platform. Here i am trying to read data from Web server and assign to variable. Since i am new bie in program i edit code got from youtube. Here i am trying to change latitude and longitude.
×
×
  • Create New...