There meight be couple of possiblities.....
Check and try the following -
1) you need to initialize the port correctly I mean input port and output port kind of staff
2) You need to also see the ports are digital or analog in PIC
3) When you are reading a input port port read bitwise and get the same bit assignment to output port bit
4) May debug mechanism using either UART or Using Programmer PIC Kit 2
Also, if possible put the code or send the code... I can help in it is in C language ....
Good Luck