POST data from SD cadr CSV file

Hello, and thank you ahead of time for any help you can give.

I have a GPS tracker powered by an arduino MEGA / adafruit ultimate gps logger shield / sparkfun ESP8266 WiFi Shield.

I have hit a full standstill I cannot get the data off the SD card in a form that i can POST it to my PHP page.
Can anyone help with code for that.

Here is the specific code i have at this time and im stuck.

void runupload()
{
#define errorHalt(msg) {Serial.println(F(msg)); while(1);}
file = SD.open(“LOG.CSV”, FILE_READ);
if (!file) errorHalt(“open failed”);
// Rewind the file for read.
file.seek(0);

size_t n; // Length of returned field with delimiter.
char str[20]; // Must hold longest field with delimiter and zero byte.

// Read the file and print fields.
while (true) {
n = readField(&file, str, sizeof(str), “,\n”);

// done if Error or at EOF.
if (n == 0) break;

// Print the type of delimiter.
if (str[n-1] == ‘,’ || str[n-1] == ‘\n’) {
Serial.print(str[n-1] == ‘,’ ? F("comma: ") : F("endl: "));

// Remove the delimiter.
str[n-1] = 0;
} else {
// At eof, too long, or read error. Too long is error.
Serial.print(file.available() ? F("error: ") : F("eof: "));
}
// Print the field.
Serial.println(str);
data = “date_time=” + str + “lat=” + str + “lon=” + str; // THIS IS WHERE I AM STUCK
// IN HERE NEEDS TO BE THE CONNECT TO PHP AND POST DATA
delay(1000);
Serial.println(“NEW LINE”);
}
file.close();

Serial.println(“Done Upload Now”);
smartdelay(3000000000); //just for testing to stop program.
}

I have hit a full standstill I cannot get the data off the SD card in a form that i can POST it to my PHP page.

Why do you need to use POST? GET is much simpler.

  smartdelay(3000000000);

Idiot. smartdelay() is not smart, and that period of time makes no damned sense.

    data = "date_time=" + str + "lat" + str + "lon"; // THIS IS WHERE I AM STUCK
         // IN HERE NEEDS TO BE THE CONNECT TO PHP AND POST DATA

You plan to POST every field individually? Sending the same value for date and time and for latitude, with no value for longitude hardly makes sense.

Nor does posting snippets. http://www.snippets-r-us.com

POST or GET which ever one works. That's why I am asking questions.

The long delay is not for function. Just to stop the program while I'm testing trying to get this rite.

That's my problem I can't get individual information to post. As I try to concatenate it just puts the same value for each variable.

Instead of just calling me an idiot .... Could you help me out???

That's my problem I can't get individual information to post.

Because you don't have any code to POST anything.

You read ONE field from the CSV file, and then claim you want to post three different values. Well, guess what? You have to ACTUALLY read three different values, first.

Then, you need to connect to the server. Then, you need to formulate the POST buffer, measure its length, and then send the commands to post the data.

Yes, that is what I need to do... But I don't know how to do any of that?....
That's the whole point of this question...
That's why I just commented what I wanted to do because I don't know how to write the code to do it.....

I have found examples to write with the ethernet library but I am using the spark fun esp8266 shield and not sure how to make the client connection with that. I can figure that out later on. My biggest issue rite now is reading the values from the csv file.
That is what I need help with.
If you can give me some code to pull date_time lat lon from the csv file.

The format is date_time, lat, lon
And there's over 500 lines in the csv file. So I want to pull each value and put it in
log.php?date_time=date_time&lat=lat&lon=lon
Then POST or GET that to the server. But I can figure that out later.
One line at a time.

If you can give me some code to pull date_time lat lon from the csv file.

You have a function, readField(). What does it actually read? Why, if the file is comma separated values, are you not calling it three times, the first two with comma as the delimiter and the third with \n as the delimiter, to get the three fields?

THAT is the first step.