Mmmmm. For now I’m going to concentrate on getting those MAC values out of the URL. I made a more simple version to show what it is doing:
first time the sketched is ran:

when you press the submit button, as you can see things go wrong when MAC address is submitted

and here you have the code:
#include <SPI.h>
#include <Ethernet.h>
#include <TextFinder.h>
#include <EEPROM.h>
//seting up the EthernetShield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip[] = {192,168,1,2};
byte subnet[] = {255,255,255,0};
byte gateway[] = {192,168,1,1};
Server server(80);
const byte ID = 0x91; //used to identify if valid data in EEPROM the "know" bit,
// if this is written in EEPROM the sketch has ran before
// We use this, so that the very first time you'll run this sketch it will use
// the values written above.
void setup()
{
ShieldSetup (); //Setup the Ethernet shield
server.begin(); //starting the server
}
void ShieldSetup()
{
int idcheck = EEPROM.read(0);
if (idcheck != ID){
//ifcheck id is not the value as const byte ID,
//it means this sketch has NOT been used to setup the shield before
//just use the values written in the beginning of the sketch
Ethernet.begin(mac, ip, gateway, subnet);
}
if (idcheck == ID){
//if id is the same value as const byte ID,
//it means this sketch has been used to setup the shield.
//So we will read the values out of EERPOM ans use them
//to setup the shield.
for (int i = 0; i < 6; i++)
{
mac[i] = EEPROM.read(i+1);
}
for (int i = 0; i < 4; i++)
{
ip[i] = EEPROM.read(i+7);
}
}
Ethernet.begin(mac, ip, gateway, subnet);
}
void loop()
{
Client client = server.available();
if (client) {
TextFinder finder(client );
while (client.connected()) {
if (client.available()) {
if( finder.find("GET /") ) {
if (finder.findUntil("SBM", "\n\r")){ //when "SBM" is found a form has been submitted.
byte SET = finder.getValue();
while(finder.findUntil("DT", "\n\r")){ //look for "DT" and get all the values
int val = finder.getValue(); // get all the numbers behind DT => DT1, DT2, ...
if(val >= 1 && val <= 6) { // now for DT1 till DT6 means value for MAC
mac[val - 1] = finder.getValue(); // get the value behind the "=" => DT1=..
}
if(val >= 7 && val <= 10) { // now for DT7 till DT10 means value for IP
ip[val - 7] = finder.getValue(); // get the value behind the "=" => DT7=..
}
}
for (int i = 0 ; i < 6; i++)
{
EEPROM.write(i + 1,mac[i]); //write those MAC values to EEPROM
}
for (int i = 0 ; i < 4; i++)
{
EEPROM.write(i + 7, ip[i]); //write those IP values to EEPROM
}
//set ID to the known bit, so when you reset the Arduino
//from now on it will use the EEPROM values
EEPROM.write(0, 0x91);
// if al the data has been written to EEPROM we should reset the arduino
// for now you'll have to use the hardware reset button
}
}
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.print("<html><body><table><form><input type=\"hidden\" name=\"SBM\" value=\"1\">");
client.print("<tr><td>MAC: <input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT1\" value=\"");
client.print(mac[0],HEX);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT2\" value=\"");
client.print(mac[1],HEX);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT3\" value=\"");
client.print(mac[2],HEX);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT4\" value=\"");
client.print(mac[3],HEX);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT5\" value=\"");
client.print(mac[4],HEX);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT6\" value=\"");
client.print(mac[5],HEX);
client.print("\"></td></tr><tr><td>IP: <input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT7\" value=\"");
client.print(ip[0],DEC);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT8\" value=\"");
client.print(ip[1],DEC);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT9\" value=\"");
client.print(ip[2],DEC);
client.print("\">.<input type=\"text\" size=\"3\" maxlength=\"3\" name=\"DT10\" value=\"");
client.print(ip[3],DEC);
client.print("\"></td></tr><tr><td><input type=\"submit\" value=\"SUBMIT\"></td></tr>");
client.print("</form></table></body></html>");
break;
}
}
delay(1);
client.stop();
}
}