how can i print the value of temperatures on webpage

#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"

#define DHTPIN 2     // what pin we're connected to

#define DHTTYPE DHT11   // DHT 11
DHT dht(DHTPIN, DHTTYPE);

// 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,111);

// Initialize the Ethernet server library
// with the IP address and port you want to use 
// (port 80 is default for HTTP):
EthernetServer server(8989);



String readString = String(100); //string for fetching data from address
void setup()
{
  Serial.begin(9600);
dht.begin();
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);

  // start the Ethernet connection and the server:

  Serial.println(F("Initiaizing ethernet..."));

  // this uses a fixed address
  Ethernet.begin(mac, ip);

  // get an address with DHCP
  //if (Ethernet.begin(mac) == 0)
  //  Serial.println("Failed to configure Ethernet using DHCP");

  // give the card a second to initialize 
  delay(1000);

  server.begin();

  Serial.print(F("Ready at IP address "));
  Serial.println(Ethernet.localIP());
}


void loop()
{

 float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT");
  } else {
    delay(10);
    Serial.print("Humidity: ");
    Serial.print(h);
    Serial.print(" %\t");
    Serial.print("Temperature: ");
    Serial.print(t);
    Serial.println(" *C");
  }

  // command received (one character)  '1' - activate garage door button
  char cmd = 0;          // 1 - pulse button
  boolean done = false;  // set to indicate that response is complete

  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {

    Serial.println(F("new client"));
    readString = "";

    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        //int i = c;
        //Serial.print("(");
        //Serial.print(i);
        //Serial.print(")");

        // store character received in receive string
        if (readString.length() < 100) {
          readString += (c);
        }

        // check for end of line
        if (c == '\n') {
            //Serial.print("Receved line: ");
            //Serial.print(readString);  


            // process line if its the "GET" request
            // a request looks like "GET /?1" or "GET /?2"
            if (readString.indexOf("GET") != -1) {
                if (readString.indexOf("?1") != -1)
                   cmd = '1';
                // check for other commands here. ie turn on light, etc.
                if (readString.indexOf("?2") != -1)
                   cmd = '2';  
                                  if (readString.indexOf("?3") != -1)
                   cmd = '3'; 
                                  if (readString.indexOf("?4") != -1)
                   cmd = '4'; 
                                  if (readString.indexOf("?5") != -1)
                   cmd = '5'; 
                                  if (readString.indexOf("?6") != -1)
                   cmd = '6'; 
                                  if (readString.indexOf("?7") != -1)
                   cmd = '7';
                                 if (readString.indexOf("?8") != -1)
                   cmd = '8'; 
   
            }              

           // if a blank line was received (just cr lf, length of 2), then its the end of the request
           if (readString.length() == 2) {
             if (cmd == '1'){
                Serial.println(F("Activate Button"));
                digitalWrite(6, HIGH);

             }
                          if (cmd == '2'){
                Serial.println(F("Activate Button"));
                digitalWrite(6, LOW);

             }
                          if (cmd == '3'){
                Serial.println(F("Activate Button"));
                digitalWrite(5, HIGH);

             }
                          if (cmd == '4'){
                Serial.println(F("Activate Button"));
                digitalWrite(5, LOW);

             }
                          if (cmd == '5'){
                Serial.println(F("Activate Button"));
                digitalWrite(7, HIGH);

             }
                          if (cmd == '6'){
                Serial.println(F("Activate Button"));
                digitalWrite(7, LOW);

             }
                          if (cmd == '7'){
                Serial.println(F("Activate Button"));
                digitalWrite(8, HIGH);

             }
                          if (cmd == '8'){
                Serial.println(F("Activate Button"));
                digitalWrite(8, LOW);

             }

             // add other commands here
            client.println(c);
             // send web page back to client 
             Serial.println(F("sending web page"));
             SendWebPage(client); 
             Serial.println(F("web page sent"));

             cmd = 0;

             // break out and disconnect. This will tell the browser the request is complete without having to specify content-length
             break;

           }  // end of request reached

           // start line over            
           readString = "";
          }  // end of line reached
      }  // end data is available from client
    }  // end cient is connected
    // give the web browser time to receive the data
    Serial.println(F("delay before disconnect"));
    delay(100);
    // close the connection:
    client.stop();
    Serial.println(F("client disonnected")); 
  }  // end client has been created
}


// send web page
void SendWebPage(EthernetClient client)
{
   client.println(F("HTTP/1.1 200 OK")); 
   client.println(F("Content-Type: text/html")); 
   // to specify the length, wooul have to construct the entire string and then get its length
   //client.println("Content-Length: 1234"); 
   client.println(F("Connnection: close")); 
   client.println(); 

   client.println(F("<!DOCTYPE HTML>"));
   client.println(F("<html>"));
   client.println(F("<head>"));
   client.println(F("<title>Home Automation Control</title>"));

   client.println(F("<style type='text/css'>"));
   client.println(F(".label {font-size: 30px; text-align:center;}"));
   client.println(F("button {width: 160px; height: 70px; font-size: 30px; -webkit-appearance: none; background-color:#dfe3ee; }"));
   client.println(F("</style>"));

   client.println(F("<script type='text/javascript'>"));

   client.println(F("function OnButtonClicked(parm) { window.location.href=\"X?\" + parm; }"));

   client.println(F("</script>"));

   client.println(F("</head>"));

   client.println(F("<body style=\"background-color:#3b5998\">"));

   client.println(F("<div class=\"label\">"));
   client.println(F("Home Auotmation Control

"));
   // future idea: could read a limit switch on the garage door here and tell the user if the door is currently open or closed
   /*
   if (digitalRead(DOOR_OPEN_INPUT) == HIGH)
     client.println("Door is Open"); 
   else  
     client.println("Door is Closed"); 
   client.println("
");
   */

   // door open / close button
   if (digitalRead(6)==LOW)
   {
   client.println(F("<button onclick=\"OnButtonClicked('1');\">1ON</button>

"));
   }if (digitalRead(6)==HIGH){
   client.println(F("<button onclick=\"OnButtonClicked('2');\">1Off</button>

"));
   }   if (digitalRead(5)==LOW)
   {
   client.println(F("<button onclick=\"OnButtonClicked('3');\">2ON</button>

"));
   }if (digitalRead(5)==HIGH){
   client.println(F("<button onclick=\"OnButtonClicked('4');\">2Off</button>

"));
   }  if (digitalRead(7)==LOW)
   {
   client.println(F("<button onclick=\"OnButtonClicked('5');\">3ON</button>

"));
   }if (digitalRead(7)==HIGH){
   client.println(F("<button onclick=\"OnButtonClicked('6');\">3Off</button>

"));
     }   if (digitalRead(8)==LOW)
   { 
   client.println(F("<button onclick=\"OnButtonClicked('7');\">4ON</button>

"));
   }if (digitalRead(8)==HIGH){
     
   client.println(F("<button onclick=\"OnButtonClicked('8');\">4Off</button>

"));
   }
   // add more buttons here
   // button separator



   client.println(F("</div>"));

   client.println(F("</body>"));
   client.println(F("</html>"));

   client.println("");
}

i can’t make this work, if i add client.print(c); it gives me a lot of errors like ‘c’ was not declared in this scope please somebody help me :confused:

One way to get data displayed on a web page.

// zoomkat's meta refresh data frame test page 5/25/13
// use http://192.168.1.102:84 in your brouser for main page
// http://192.168.1.102:84/data static data page
// http://192.168.1.102:84/datastart meta refresh data page
// for use with W5100 based ethernet shields
// set the refresh rate to 0 for fastest update
// use STOP for single data updates

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

const int analogInPin0 = A0;
const int analogInPin1 = A1;
const int analogInPin2 = A2;
const int analogInPin3 = A3;
const int analogInPin4 = A4;
const int analogInPin5 = A5;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // arduino ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port
unsigned long int x=0; //set refresh counter to 0
String readString; 

//////////////////////

void setup(){
  Serial.begin(9600);
    // disable SD SPI if memory card in the uSD slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  server.begin();
  Serial.println("meta refresh data frame test 5/25/13"); // so I can keep track of what is loaded
}

void loop(){
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
         if (readString.length() < 100) {
          readString += c; 
         } 
        //check if HTTP request has ended
        if (c == '\n') {

          //check get atring received
          Serial.println(readString);

          //output HTML data header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();

          //generate data page
          if(readString.indexOf("data") >0) {  //checks for "data" page
            x=x+1; //page upload counter
            client.print("<HTML><HEAD>");
            //meta-refresh page every 1 seconds if "datastart" page
            if(readString.indexOf("datastart") >0) client.print("<meta http-equiv='refresh' content='1'>"); 
            //meta-refresh 0 for fast data
            if(readString.indexOf("datafast") >0) client.print("<meta http-equiv='refresh' content='0'>"); 
            client.print("<title>Zoomkat's meta-refresh test</title></head><BODY>
");
            client.print("page refresh number: ");
            client.print(x); //current refresh count
            client.print("

");
            
              //output the value of each analog input pin
            client.print("analog input0 is: ");
            client.print(analogRead(analogInPin0));
            
            client.print("
analog input1 is: ");
            client.print(analogRead(analogInPin1));
                        
            client.print("
analog input2 is: ");
            client.print(analogRead(analogInPin2));
            
            client.print("
analog input3 is: ");
            client.print(analogRead(analogInPin3));
                                    
            client.print("
analog input4 is: ");
            client.print(analogRead(analogInPin4));
            
            client.print("
analog input5 is: ");
            client.print(analogRead(analogInPin5));
            client.println("
</BODY></HTML>");
           }
          //generate main page with iframe
          else
          {
            client.print("<HTML><HEAD><TITLE>Zoomkat's frame refresh test</TITLE></HEAD>");
            client.print("Zoomkat's Arduino frame meta refresh test 5/25/13");
            client.print("

Arduino analog input data frame:
");
            client.print("&nbsp;&nbsp;<a href='http://192.168.1.102:84/datastart' target='DataBox' title=''yy''>META-REFRESH</a>");
            client.print("&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://192.168.1.102:84/data' target='DataBox' title=''xx''>SINGLE-STOP</a>");
            client.print("&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://192.168.1.102:84/datafast' target='DataBox' title=''zz''>FAST-DATA</a>
");
            client.print("<iframe src='http://192.168.1.102:84/data' width='350' height='250' name='DataBox'>");
            client.print("</iframe>
</HTML>");
          }
          delay(1);
          //stopping client
          client.stop();
          //clearing string for next read
          readString="";
        }
      }
    }
  }
}

Check ThingSpeak.com You can upload your data and it will show a graphical display.