Problem in pushing data to server

Hi,

I just want to push the tag information to server using Arduino WiFi shield. The connection part is clear. But the only thing is data are not pushing into server. Can anyone help me to resolve this?

#include <SPI.h>
#include <WiFi.h>
int val = 0;
char code[10];
int bytesread = 0;
char ssid = “UTStarcom-bsnl”; // your network SSID (name) //ITS OpEN
IPAddress server ( 184, 106, 153, 149 );
int status = WL_IDLE_STATUS;
// Initialize the Wifi client library
WiFiClient client;
// server address:
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
boolean lastConnected = false; // state of the connection last time through the main loop
const unsigned long postingInterval = 5*1000; // delay between updates, in milliseconds
String writeAPIKey = “6ZBMK0KXQTVS7FJW”; //ur thingspeak api???
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println(“WiFi shield not present”);
// don’t continue:
while(true);
}
String fv = WiFi.firmwareVersion();
if( fv != “1.1.0” )
Serial.println(“Please upgrade the firmware”);

// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid);

// wait 10 seconds for connection:
delay(10000);
}
// you’re connected now, so print out the status:
printWifiStatus();
}

void loop() {
int i, k = 0;
// if there’s incoming data from the net connection.
// send it out the serial port. This is for debugging
// purposes only:
if(Serial.available() > 0) { // if data available from reader
if((val = Serial.read()) == 10) { // check for header
bytesread = 0;
while(bytesread<10) { // read 10 digit code
if( Serial.available() > 0) {
val = Serial.read();
if((val == 10)||(val == 13)) { // if header or stop bytes before the 10 digit reading
break; // stop reading
}
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
}
}
if(bytesread == 10) { // if 10 digit read is complete

Serial.println(code);

for (i = 0; i <= 10; i++)
k = 10 * k + code*; // print the TAG code*

  • }*

  • bytesread = 0;*

  • }*

  • }*

  • if (client.available()) {*

  • char c = client.read();*

  • Serial.write(c);*

  • client.stop();*

  • }*

  • // if there’s no net connection, but there was one last time*

  • // through the loop, then stop the client:*

  • if (!client.connected() && lastConnected) {*

  • Serial.println();*

  • Serial.println(“disconnecting.”);*

  • client.stop();*

  • }*

  • if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {*

  • httpRequest(“field1=”+k);*

  • }*

  • lastConnected = client.connected();*

}
// this method makes a HTTP connection to the server:
void httpRequest(String tsData) {

  • // if there’s a successful connection:*

if (client.connect(server, 80)) {
client.println(“GET /update?key=”);
client.println(writeAPIKey);
client.println("&");
client.println(tsData);
// note the time that the connection was made:
lastConnectionTime = millis();

  • }*
  • else {*
  • // if you couldn’t make a connection:*
  • Serial.println(“connection failed”);*
  • Serial.println(“disconnecting.”);*
  • client.stop();*
  • }*
    }
    void printWifiStatus() {
  • // print the SSID of the network you’re attached to:*
  • Serial.print("SSID: ");*
  • Serial.println(WiFi.SSID());*
  • // print your WiFi shield’s IP address:*
  • IPAddress ip = WiFi.localIP();*
  • Serial.print("IP Address: ");*
  • Serial.println(ip);*
  • // print the received signal strength:*
  • long rssi = WiFi.RSSI();*
  • Serial.print(“signal strength (RSSI):”);*
  • Serial.print(rssi);*
  • Serial.println(" dBm");*
    }