I need help with arduino shield ethernet

I need to link this code with the above

This crap, you mean. You don't seem to have learned the benefits of properly indented code from a readability/comprehensibility/maintainability point of view. Tools + Auto Format is there for a reason.

Regardless, you have our permission to merge the two codes. Without knowing what your requirements are for the resulting program, we can't help you do it.