Basic HTML button code not working

I got this sketch out of an arduino cookbook and tried it but the led is no power is coming out of pin 8. The code is supposed to allow you to press on or off using a computer on your network using your IP and when the on button is pushed the pin 8 is supposed to receive power but its not. I just got the arduino ethernet shield, so I am new to how it works. What I did was, type the sketch in the Arduino IDE and kept it set to Arduino UNO which is the type of board that the Ethernet shield is connected to and I had them both connected when I uploaded the sketch. Was this correct or was I supposed to switch the board type to Arduino Ethernet? Not sure, by the way here is the code:

/*
*WebServerPost sketch
*Turns pin 7 on and off using HTML form
*/

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0xD7, 0xD8};
byte ip[] = {192,168,2,8};

const int MAX_PAGENAME_LEN=8;
char buffer[MAX_PAGENAME_LEN+1];

EthernetServer server(80);

void setup()
{
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  server.begin();
  delay(2000);
}

void loop()
{
  EthernetClient client = server.available();
  if (client) {
    int type = 0;
    while (client.connected()){
      if (client.available()){
        memset(buffer,0, sizeof(buffer));
        if(client.find("/"))
        if(client.readBytesUntil('/', buffer,sizeof(buffer))){
          Serial.println(buffer);
          if(strcmp(buffer, "POST") ==0){
            client.find("\n\r");
            while(client.findUntil("pinD", "\n\r")){
              int pin = client.parseInt();
              int val = client.parseInt();
              pinMode(pin, OUTPUT);
              digitalWrite(pin, val);
            }
          }
          sendHeader(client, "Post example");
          client.println("<h2>Click buttons to turn pin 8 on or off</h2>");
          client.print(
          "<form action='/' method='POST'> <p><input type='hidden' name='pinD8'");
          client.println(" value='0'><input type='submit' value='OFF'/></form>");
          client.print(
          "<form action='/' method='POST'><p><input type='hidden' name='pinD8'");
          client.print("value='1'><input type='submit' value='On'/></form>");         
          client.println("</body></html>");
          client.stop();
        }
        break;
      }
    }
    delay(1);
    client.stop();
  }
}
void sendHeader(EthernetClient client, char *title)
{
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println();
  client.print("<html><head><title>");
  client.print(title);
  client.println("</title><body>");
}

Simple pin/servo web page test code.

//zoomkat 4-1-12
//simple button GET for servo and pin 5
//for use with IDE 1.0
//open serial monitor to see what the arduino receives
//use the \ slash to escape the " in the html, or use ' instead of " 
//address will look like http://192.168.1.102:84 when submited
//for use with W5100 based ethernet shields

#include <SPI.h>
#include <Ethernet.h>

#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port

String readString; 

//////////////////////

void setup(){

  pinMode(5, OUTPUT); //pin selected to control
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  server.begin();

  myservo.write(90); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  //enable serial data print 
  Serial.begin(9600); 
  Serial.println("server servo/pin 5 test 1.0"); // so I can keep track of what is loaded
}

void loop(){
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {

          //store characters to string 
          readString += c; 
          //Serial.print(c);
        } 

        //if HTTP request has ended
        if (c == '\n') {

          ///////////////
          Serial.println(readString); //print to serial monitor for debuging 

          client.println("HTTP/1.1 200 OK"); //send new page
          client.println("Content-Type: text/html");
          client.println();

          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Arduino GET test page</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");

          client.println("<H1>Zoomkat's simple Arduino button</H1>");
          
          client.println("<a href='/?on'>ON</a>"); 
          client.println("<a href='/?off'>OFF</a>"); 

          client.println("</BODY>");
          client.println("</HTML>");
 
          delay(1);
          //stopping client
          client.stop();

          ///////////////////// control arduino pin
          if(readString.indexOf("on") >0)//checks for on
          {
            myservo.write(40);
            digitalWrite(5, HIGH);    // set pin 4 high
            Serial.println("Led On");
          }
          if(readString.indexOf("off") >0)//checks for off
          {
            myservo.write(140);
            digitalWrite(5, LOW);    // set pin 4 low
            Serial.println("Led Off");
          }
          //clearing string for next read
          readString="";

        }
      }
    }
  }
}