The ancient 16F877A is not a good choice if you want to be a regular network citizen. It has too little code space to do a proper TCP implementation and still have anything left over for the application. It could be OK if you just want to transmit and receive network packets using your own protocol.
However, there are newer chips that cost the same or less than the 16F877A and are far more capable. I'd look into the 18F67J60. It has lots more code space, more RAM, and comes with the ENC28J60 built in. You can do a full TCP stack and still have something like 85% of the code space left over for the application. It is probably cheaper and is certainly smaller and more capable than the 16F877A and ENC28J60 together.