so i've unlocked iphones before, and my cousin gave me a 3g to try and fix for him but im lost.. the only time it boots is when it gets plugged into the computer. but yet the computer and itunes wont recognize it. while booting it stays on the apple logo for a few then shuts right down.. Is the phone bricked?
Try putting it in DFU mode after you plug it in. Also try another cable if that doesn't work... Have seen issues with cables before. Could be the battery... Some USB ports/laptops won't charge an iPhone, so it might be dying each time. Does it start to boot when you plug it in the wall? It's unlikely that it's completely bricked if it's coming on in some capacity.