Ahh right, I think I understand how it work's now.
bfill.emit_p(progmem string) takes a pstr() and replaces anything with $... with one of the other arguments in a similar way to sprintf.
$D = word data type
$L = long data type
$S = c string
$F = progmem string
$E = byte from the eeprom.
So what needs to be done is to convert the solution I gave you in your other thread to work with this instead of sprintf.
As a reference this is what was used before.
char string[150];
void loop()
{
char* params;
if (params = e.serviceRequest())
{
int startIndex = strcspn (params,"01"); //Find the first '1' or '0' in the parameters string
for(byte i = 0; i < 5; i++){ //Work through each button in turn
char ledStatus[6] = {0};
strncpy(ledStatus, params + startIndex, 5); //Extract the 5 led statuses to a char array
digitalWrite(LED[i],(ledStatus[i] == '1')?true:false); //Output to the correct LED
ledStatus[i] = (ledStatus[i] == '1')?'0':'1'; //Swap the status for sending back in the HTML
sprintf(string,"<a href='?led=%s'>
<button style='border: 1px solid #ff0000; border-left: 10px solid #ff0000' type='button'>LED%d IS %s</button></a>",i+1, ledStatus,((ledStatus[i] == '1')?"ON":"OFF"));
e.print(string);
}
}
}
So, lets use the same URLs, e.g. ?led=00101 etc. and I will walk you through one way in which you could build the code. Learning is fun 
from your new code, the pointer to the recieved string is called data:
...
char *data = (char *) Ethernet::buffer + pos;
if (strncmp("GET /", data, 5) != 0) {
// Unsupported HTTP request
// 304 or 501 response would be more appropriate
bfill.emit_p(http_Unauthorized);
} else {
data += 5;
...
So we'll use that instead of params. To start with, as before, we need to work out where the important part of the string starts, i.e. the '0's and '1's. The function strcspn does this. It starts at the given pointer and finds te relative position of the first character it finds which matches one of the characters from the given list.
So where are we at so far. Based on your current code, this is a starting point:
...
char *data = (char *) Ethernet::buffer + pos;
if (strncmp("GET /", data, 5) != 0) {
// Unsupported HTTP request
// 304 or 501 response would be more appropriate
bfill.emit_p(http_Unauthorized);
} else {
data += 5;
if (data[0] == ' ') { //Check if the home page, i.e. no URL
homePage();
} else if (!strncmp("?led=",data,5)){ //Check if a url which changes the leds has been recieved
data += strcspn (data,"01"); //Move to the start of the URL
for(byte i = 0; i < 5; i++){ //Work through each led in turn, lets say for example there are 5 LEDs
... //Something here to change the LEDs.
}
bfill.emit_p(http_Found);
} else { //Otherwise, page isn't found
// Page not found
bfill.emit_p(http_Unauthorized);
}
...
So now what, we have worked out how to recieve the data and check whether it is the required string. So next we need to be able to actually change the LEDs to what the URL demanded. Lets again assume there are 5 leds (as there were in your old thread). We shall then requre an array which says what pins the LEDs are connected to, and another which stores the URL required to change each LED.
...
#define numberOfLeds 5
byte LED[] = {2,3,4,5,6}; //This would use digital2 to digital6, but you could choose any
char LedURL[numberOfLeds][numberOfLeds +1] ={ "10000", "01000", "00100", "00010", "00001"}; //All leds begin off, so the LEDs in the array are off except for the one which a given hyperlinks would turn on.
void setup(){
for(byte i = 0; i < numberOfLeds; i++){
pinMode(LED[i],OUTPUT); //LEDs are outputs
digitalWrite(LED[i],LOW); //Off to begin with
}
...
There will be 5 hyperlinks on the webpage which allow us to turn on
...
#define numberOfLeds 5
byte LED[numberOfLeds ] = {2,3,4,5,6}; //This would use digital2 to digital6, but you could choose any
char LedURL[numberOfLeds][numberOfLeds +1] ={ "10000", "01000", "00100", "00010", "00001"}; //All leds begin off, so the LEDs in the array are off except for the one which a given hyperlinks would turn on.
void setup(){
for(byte i = 0; i < numberOfLeds; i++){
pinMode(LED[i],OUTPUT); //LEDs are outputs
digitalWrite(LED[i],LOW); //Off to begin with
}
...
...
char *data = (char *) Ethernet::buffer + pos;
if (strncmp("GET /", data, 5) != 0) {
// Unsupported HTTP request
// 304 or 501 response would be more appropriate
bfill.emit_p(http_Unauthorized);
} else {
data += 5;
if (data[0] == ' ') { //Check if the home page, i.e. no URL
homePage();
} else if (!strncmp("?led=",data,5)){ //Check if a url which changes the leds has been recieved
data += strcspn (data,"01"); //Move to the start of the URL
char tempURL[numberOfLeds+1] = {0};
strncpy(tempURL, data, numberOfLeds); //Extract the recieved URL to the temporary string
for(byte i = 0; i < numberOfLeds ; i++){ //Check through each of the LEDs URLs
if(!strcmp(tempURL,LedURL[i])){
//The recieved URL matches the one required to turn this LED on, so we will turn it on.
digitalWrite(LED[i],(tempURL[i] == '1')?HIGH:LOW); //Set the led state to match the URL.
//Now we need to toggle the state of this LED in all of the URLs, so that all the hyperlinks can be corrected to match this state.
for(byte j = 0; j < 5; j++){
LedURL[j][i] = (tempURL[i] == '1')?'0':'1'; //Notice how we toggle the 'i'th led in each url.
}
//The URL was found, so we don't need to check any others.
break; //Exit the for loop.
}
}
bfill.emit_p(http_Found);
} else { //Otherwise, page isn't found
// Page not found
bfill.emit_p(http_Unauthorized);
}
...
So that is the LEDs delt with. Notice how there is a URL to control each LED. Take the first LED for example. In that URL the first character is the state which clicking on the button will change the first LED to be, the remaining 4 characters represent the current state of the other LEDs, as they will be unchanged. This method only works if you want to change 1 led at a time.
So now for the response. When the Arduino recieves a request to change the LED, it does so. It then updates the array of URLs. However we still haven't sent the URL back to the computer as a new hyperlink, so we will tackle that next. I believe this is the purpose of the homePage() function, so we will put it there.
Before we put some code, lets work out how it should work. Well, you send some HTML which sets the page title, and then adds an hyperlink for each LED. There will be 5 hyperlinks, each will one of the URLs the arduino needs to change each of the LEDs. The name of the hyperlink can be whatever you want, but for this example it will be either "Turn LEDx ON" or "Turn LEDx = OFF" (where x is the xth LED).
From what I can see then, there are 3 variables for the hyperlink per LED. The URL, which is a c string, the index of the LED which will be a byte (we'll use word as there is not option for byte), and the title of the hyperlink, ON or OFF, which is a cstring.
So, the code for example for LED 1 needs to be something like (note the x in the URL depends on the other leds):
"Turn LED1 <a href="?led=1xxxx">ON" to turn it on
"Turn LED1 <a href="?led=0xxxx">OFF" to turn it off
Lets break that down and make it more general. The '1' after LED is replaced with the index. The "1xxxx" is replaced by the URL, and the ON/OFF is replaced by the current state. Based on the list of wildcards I gave you at the beginning for the emit() function, this becomes:
"Turn LED$D <a href="?led=$S">$S"
$D = word = the led index
first $S = cstring = the URL
second $S = cstring = the name
So that is all we need to modify your current homePage() function...
...
void homePage(){
//$F represents p string, $D represents word or byte, $S represents string.
//There are 5 leds, so 5 hyperlinks.
bfill.emit_p(PSTR("$F"
"<meta http-equiv='refresh' content='5'/>"
"<title>Ethercard LED</title>"
"Turn LED$D <a href=\"?led=$S\">$S</a>"
"Turn LED$D <a href=\"?led=$S\">$S</a>"
"Turn LED$D <a href=\"?led=$S\">$S</a>"
"Turn LED$D <a href=\"?led=$S\">$S</a>"
"Turn LED$D <a href=\"?led=$S\">$S</a>"),
http_OK,
(word)1,LedURL[1],LedURL[1][1]?"ON":"OFF",
(word)2,LedURL[2],LedURL[2][2]?"ON":"OFF",
(word)3,LedURL[3],LedURL[3][3]?"ON":"OFF",
(word)4,LedURL[4],LedURL[4][4]?"ON":"OFF",
(word)5,LedURL[5],LedURL[5][5]?"ON":"OFF");
}
...