send data string to web server from arduino + xbee

Hi I’m new here, and I faced with the problem. I want to receive the data string and redundant data is coming in the form of char. Here my code ethernet + xbee

 #include <SPI.h>
#include <Ethernet.h>
#include <SoftwareSerial.h>
SoftwareSerial XBee (8,7);
// assign a MAC address for the ethernet controller.
// fill in your address here:
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
char inChar = Serial.read();
EthernetClient client;
char server[] = "192.168.0.121";
int i;

void setup() {
  XBee.begin(19200);
  Serial.begin(19200);
  Ethernet.begin(mac);
  Serial.print("IP Address        : ");
  Serial.println(Ethernet.localIP());
}
char data =XBee.read();

void loop() {
 
if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    XBee.write(Serial.read());
  }
  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
    char c = XBee.read();
  if (client.connect(server,80)) {
    client.print( "GET /test/add_data.php?");
    client.print("kelas=");
    client.print(inChar);
    client.print("&&");
    client.print("data=");
    client.print( c );
    client.println( " HTTP/1.1");
    client.print( "Host: " );
    client.println(server);
    client.println( "Connection: close" );
    client.println();
    client.println();
    client.stop();
      }
    }else {
    Serial.println("connection failed");
    Serial.println("disconnecting.");
  }
    delay(10000);
    }

i cannot use array in data receiver from xbee. here my xbee sender with ethernet and sdcard

#include <SPI.h>
#include <Ethernet.h>
#include <SoftwareSerial.h>
#include <SD.h>
File myFile;
byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x00, 0xE3, 0xE0 };
IPAddress ip(192,168,0, 177);
IPAddress gateway(192,168,0, 1);
IPAddress subnet(255, 255, 255, 0);
SoftwareSerial mySerial(7, 8); // RX, TX
SoftwareSerial XBee (6,5);
// telnet defaults to port 1001
EthernetServer server(1001);
boolean alreadyConnected = false; // whether or not the client was connected previously
char data=(char)0;
void setup() {
  XBee.begin(19200);
  Serial.begin(19200);
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);
  // start listening for clients
  server.begin();
 // Open serial communications and wait for port to open:

  Serial.println("Initializing SD card...");
  Serial.println("Chat server address:");
  Serial.print(Ethernet.localIP());
if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  myFile = SD.open("TA.txt", FILE_WRITE);
}
void loop() {
  // wait for a new client:
  EthernetClient client = server.available();
  // when the client sends the first byte, say hello:
  if (client) {
    while(client.connected()){
    if (!alreadyConnected) {
      // clead out the input buffer:
      client.flush();    
      Serial.println("Client Connected ");
      XBee.println("A301A");
      alreadyConnected = true;
    } 
    if (client.available() > 0) {
      // read the bytes incoming from the client:
      char thisChar = client.read();  
      Serial.write(thisChar);
      XBee.println(thisChar); 
      String stringOne = String (thisChar);
      myFile.print(stringOne);
    }
    if (myFile) {
       char thisChar = client.read();
       String stringOne = String (thisChar);
       myFile.println("Data :");
       myFile.print(stringOne);
     }
    if (Serial.available() > 0){
    char c=Serial.read();
    client.write(c);
    XBee.println(c);
    }
    if(XBee.available()>0){
      char c=XBee.read();
      Serial.write(c);
      data=c;      
      client.write(c);   
      
    char stops= 120 ;
    if(data==stops){
    client.stop(); 
    data=(char)0; 
    alreadyConnected = false;
    delay(1000);
    Serial.println("Client Disconected");
    client.stop();
      }
    }
    }
  }
  myFile.close();
  Serial.flush();
}

sorry for my english

char inChar = Serial.read();

What is this nonsense? You haven't even initialized the Serial instance.

SoftwareSerial mySerial(7, 8); // RX, TX
SoftwareSerial XBee (6,5);

Forget this. Get a Mega. You can NOT have two instances of SoftwareSerial listening at the same time. AND, you do NOT have a mySerial connected to those pins. Use a name that means something!

char data =XBee.read();

More useless crap.

  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
    char c = XBee.read();

You are sending binary data from the Serial Monitor application. Why are you sending binary data?

If one byte is available, it's a really dumb idea to read two bytes.

    client.print( "GET /test/add_data.php?");
    client.print("kelas=");
    client.print(inChar);

Send some nonsense to the client. What a great idea.

    client.print("&&");

The separator between name=value pairs is &, not &&.

    client.stop();

Without reading the server response? You just locked that socket out of use. Do this 4 times, sending ONE CHARACTER to a client, and your Ethernet shield is useless until the Arduino is rebooted.

i cannot use array in data receiver from xbee. here my xbee sender with ethernet and sdcard

You have our permission to.

      String stringOne = String (thisChar);
      myFile.print(stringOne);

Wrapping one character in a String instance is the ultimate in wastefulness. Knock that crap off.

There is nothing obvious about what the second code is doing. You seriously need to add some comments. Although I suspect that Ctrl-A, Ctrl-X would be a better use of your time.

PaulS, I'm going out on a limb here saying you've never had actual experience teaching. Why don't you actually try helping someone instead of treating them as if they are a complete idiot. Don't bring your negative attitude to the help forums. People aren't born with this knowledge.

sorry for my post.
ok i tell what i asking.

pauls : i delete if not uses

char inChar = Serial.read();//sorry this i try to get data first

i use arduino uno then i delete
SoftwareSerial mySerial(7, 8); // RX, TX
the third one i only try

char data =XBee.read();

sorry not deleted this code
then i want get data from xbee

  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
    char c = XBee.read();//this code if xbee read

i want change char c using string to post data to web

this my php

<?php
    // Connect to MySQL
    include("dbconnect.php");

    // Prepare the SQL statement
    $SQL = "INSERT INTO test.data (kelas ,data) VALUES ('".$_GET["kelas"]."', '".$_GET["data"]."')";     

    // Execute SQL statement
    mysql_query($SQL);

    // Go to the review_data.php (optional)
    header("Location: review_data.php");
?>

sorry for sdcard code

String stringOne = String (thisChar);
      myFile.print(stringOne);// this deleted too

sorry for that code. i want write string data from my android to arduino using wifi. then data write to sdcard. and then sdcard only write Ý not clear data. i write from my android 10000

@PaulS, Please, tone it down. There really is no need for that kind of language and attitude.

I won't ask again.