A USB port is probably the easiest fix you'll find on a personal computer. The USB port has 5 pins as seen in the diagram below.
If the port works sometimes then there is simply a loose connection inside the case. With a desktop PC the colors will match the diagram. However as a laptop has to sacrifice a lot to get to such a small size these colors are likely missing. If you have a multimeter (set to ~5vDC) then you can test which pins are which. The red lead will be about 5V, black lead should be 0V, and the green and white leads should be about +/- 3v
Connect the black lead to a ground or even to the outer rectangular case of the USB port as this is also ground and use the red lead to test each pin. Be careful to avoid crossing wires as this will make your problem worse. If you have a known working USB port then test that one. They will all follow the same standard.
The next part will be to open the case again and check the connections. If the actual port is too far gone that a small dap of super glue wont fix it then you may want to buy a female USB cable and. You will need to remove the old USB port, strip the new wire so that only the casing and a small amount of wire is left. Solder this wire in the same order the original wire was mounted. Test the port. If it works, use a small amount of super glue around the edges of the port inside the case.
If all goes well you'll have your USB port back and running in an afternoon.
Certificate III: General Information Technology
2nd year Electrical Engineering student
Local repair business; fixing PC's for 8 years