PaulS:
I've been writing C code for 30 years. I've used, in that time, exactly one goto statement, in a parser. Your code is unnecessarily riddled with them. A simple do/while statement with if blocks would eliminate the need for all of them.Some functions would be useful, too.
You need to explain why you are throwing away random amounts of unread data (Serial.flush()) or why it is necessary at that point to block until the output buffer is empty, depending on which version of the IDE you are using. If you can't, it's time to employ the delete key.
You seem to have forgotten to include the output that you are seeing.
And, you've forgotten to mention whether you can send data to any server other than pachube.
tq sir for replying, as I said earlier sir, I am not a programmer , and it is difficult for myself even to understand the codes.The codes actually from seeduino.com ,and I just copy and delete irrelevant code for me and put necessary info such as my API key and local ISP, because from my understanding , basically the code is design for seeduino stalker module + arduino ,which consist data to be stored to SD card first. but I did not need that as I want just to send one data at a time.so no storing is needed. Actually to be honest sir, I did not understand half of the code.So I dont know which one is need and which one is not need.I am sorry , I really tried my best.I know it's a lot to understand , but the project is due in short time, and I did not have a lot of time to study all of this by myself.I dont know why , my lecturer give me this project.can u help me construct simple AT command for this.and i will try myself to understand it and tweak it for my purpose.