Need guidance on code and configuration for ethernet shield

Hi, I have asked a question before on this site about using the ethernet shield but now I have more questions. I have built a home security system using an uno. I am using a keypad with a code to arm and disarm the system. Now I want to upgrade it by being able to control the system using the ethernet shield. I'd like to be able to arm and disarm the system from my phone when I'm leaving or coming home. Also I want to receive a text whenever my system is armed, disarmed or if my alarm is going off. I am having trouble finding an example code or library that can help me with this. If anyone has anything they can give me it would be much appreciated.

Here is as far as I have gotten:

  1. I have used the dhcpAddressPrinter to get my ip address for the arduino
  2. I have configured my router, which is a netgear wireless-n 300 model #WNR2000v2, to do portforwarding, which I somewhat understand, also set it a static ip.
  3. I have downloaded two different apps on my phone. Arduino Controller and Arduino Commander. Neither of which I am sure how to use.
  4. I have tried to connect to my arduino via my phone through both these apps to no avail.
  5. I used the ethernetserver() library to try to make this connection. I got this off the arduino website and didn't make any changes to it other than putting in my ip, mac address ect.

I am not sure where to go from here or what to do. The ethernetserver() code that I am using is asking to put in a ip address, a mac address, a subnet and a gateway. I am not sure what to use. The ip I got from the dhcpAddressPrinter and the mac address comes with the ethernet shield but on the subnet and gateway am I suppose to use the one for the internet port or the LAN port? Also on the apps for my phone it asks to add a host : ip address and port #. I put the internet ip and a random port which i chose during port forwarding to be directed to my arduino. Is this right? PLEASE HELP

Combined client and server test code. The client part could be changed to send an email based on an event.

//zoomkat 7-03-12, combined client and server
//simple button GET with iframe code
//for use with IDE 1.0
//open serial monitor and send an g to test client and
//see what the arduino client/server receives
//web page buttons make pin 5 high/low
//use the ' in html instead of " to prevent having to escape the "
//address will look like http://192.168.1.102:84 when submited
//for use with W5100 based ethernet shields
//note that the below bug fix may be required
// http://code.google.com/p/arduino/issues/detail?id=605

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //assign arduino mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan assigned to arduino
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port arduino server will use
EthernetClient client;
char serverName[] = "web.comporium.net"; // (DNS) zoomkat's test web page server
//byte serverName[] = { 208, 104, 2, 86 }; // (IP) zoomkat web page server IP address

String readString; //used by server to capture GET request 

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

void setup(){

  pinMode(5, OUTPUT); //pin 5 selected to control
  Ethernet.begin(mac,ip,gateway,gateway,subnet); 
  server.begin();
  Serial.begin(9600); 
  Serial.println("server/client 1.0 test 7/03/12"); // keep track of what is loaded
  Serial.println("Send an g in serial monitor to test client"); // what to do to test client
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) 
  {
    byte inChar;
    inChar = Serial.read();
    if(inChar == 'g')
    {
      sendGET(); // call client sendGET function
    }
  }  

  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 

            //now output HTML data header
          if(readString.indexOf('?') >=0) { //don't send new page
            client.println("HTTP/1.1 204 Zoomkat");
            client.println();
            client.println();  
          }
          else {   
            client.println("HTTP/1.1 200 OK"); //send new page on browser request
            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 1.0 button</H1>");

            client.println("<a href='/?on' target='inlineframe'>ON</a>"); 
            client.println("<a href='/?off' target='inlineframe'>OFF</a>"); 

            client.println("<IFRAME name=inlineframe style='display:none'>");          
            client.println("</IFRAME>");

            client.println("</BODY>");
            client.println("</HTML>");
          }

          delay(1);
          //stopping client
          client.stop();

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

        }
      }
    }
  }
} 

//////////////////////////
void sendGET() //client function to send and receive GET data from external server.
{
  if (client.connect(serverName, 80)) {
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.0");
    client.println();
  } 
  else {
    Serial.println("connection failed");
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read();
    Serial.print(c);
  }

  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop();

}

This is the code I am using for my security system. It might not be pretty but it works and I'm a beginner. I somehow have to implement a code to use the ethernet with what I already have.

/*
||  Simple Password Entry Using Matrix Keypad
||  4/5/2012 Updates Nathan Sobieck: Nathan@Sobisource.co
||  Burlar Alarm
*/


//* is to validate password   
//# is to reset password attempt

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

#include <Password.h> //http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip
#include <Timer.h>

Password password = Password( "1234" ); // my passcode

const byte ROWS = 4; // Four rows
const byte COLS = 3; //  columns
// Define the Keymap
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};

byte rowPins[ROWS] = { 2, 7, 6, 4 };// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = { 3, 1, 5 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.

// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

int redPin = 9; // represents alarm being off (at home) LED
int bluePin = 15 ; // represents alarm being on (not home) LED
int checkRedLight = 8; // checks to see if alarm is off
int motionSensorsOn = 16; // Infared sensors turned on
int doorSensorsOn = 17; // Turns door sensors on
int checkDoorSensors = 18; // checks to see if door contacts have been broken or not
int checkMotionSensors = 14; // checks to see if the infared sensors have picked up any movement
int triggerAlarm = 19;// Sets off the burglar alarm
int iCanSeeYou = 0;
int val_2 = 0;
int val_3 = 0;
int val_4 = 0;
int val_5 = 0;
int i;
int armedCheck; // function used to monitor all sensors
int setAlarmOff; // function used to set burglar alarm off
int turnCamerasOn;  // function to turn on cameras
Timer t;

void setup(){

  pinMode (redPin, OUTPUT);
  pinMode (bluePin, OUTPUT);
  pinMode (motionSensorsOn, OUTPUT);
  pinMode (doorSensorsOn, OUTPUT);
  pinMode (triggerAlarm, OUTPUT);
  pinMode (iCanSeeYou, OUTPUT);
  pinMode (checkDoorSensors, INPUT);
  pinMode (checkRedLight, INPUT);
  pinMode (checkMotionSensors, INPUT);

  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}

void loop(){
  keypad.getKey();
  t.update();
}

//take care of some special events
void keypadEvent(KeypadEvent eKey){
  switch (keypad.getState()){
    case PRESSED:
	switch (eKey){
	  case '*': checkPassword(); break;
	  case '#': password.reset(); break;
	  default: password.append(eKey);
     }
  }
}

void checkPassword(){                 // function to check the passcode and arm or disarm the system
  if (password.evaluate()){
     digitalWrite (bluePin, LOW);  
     digitalWrite (redPin, HIGH);
     digitalWrite (motionSensorsOn, LOW);
     digitalWrite (doorSensorsOn, LOW);
     digitalWrite (triggerAlarm, LOW);
     digitalWrite (iCanSeeYou, LOW);
     t.stop (setAlarmOff);
     t.stop (armedCheck);
 
  } else{
     digitalWrite (redPin, LOW);
       for ( i = 0; i <= 60; i++) {    // allows me 60 sec to get out of my house before all sensors are activated
         digitalWrite (bluePin, HIGH);
         delay (500);
         digitalWrite (bluePin, LOW);
         delay(500);
       }
    digitalWrite (bluePin, HIGH);
    int check = t.after(1000, setAlarm); // jumps to setAlarm function after said seconds }
}
 void setAlarm() {                    // function used to check if the system is armed and to begin the countdown to turn all sensors on 
        digitalWrite (motionSensorsOn, HIGH); 
        digitalWrite (doorSensorsOn, HIGH);
        delay(10000);
        armedCheck = t.every(1000, checkSensors);
      }  //jumps to checkSensors function every second
   

  
  void checkSensors () {             // function used to check all sensors every second
   
    val_2 = digitalRead (checkDoorSensors);
    val_4 = digitalRead (checkMotionSensors);
      if (val_4 == HIGH || val_2 == HIGH) {  
         setAlarmOff = t.after(50000, alarmOn);  // if any sensors have been triggered then it jumps to alarmOn function
         turnCamerasOn = t.after (15000, camerasOn); // if any sensors have been triggered then it jumps to cameras on 
         t.stop (armedCheck);
      }
        
  }
  
  void alarmOn() {
    val_3 = digitalRead (checkRedLight);  
      if (val_3 == LOW) {
         digitalWrite (triggerAlarm, HIGH);
         int doIt = t.after (15000, youCaughtBitch); }
      else { digitalWrite (triggerAlarm, LOW);
        t.stop (armedCheck);
      }
  }
  
  void camerasOn () {
    val_5 = digitalRead (checkRedLight);
      if (val_5 == LOW ) {
        digitalWrite (iCanSeeYou, HIGH);
      }
      else { digitalWrite (iCanSeeYou, LOW);
         t.stop (armedCheck);
      }
  }
  
  void youCaughtBitch () {
    digitalWrite (triggerAlarm, LOW);
  }