03.03.2014, 22:00
Well, duh. I don't quite think you realize what localhost refers to in different circumstances. Every computer or server has one or more localhost (loopback) addresses. If the scripts runs on the server then localhost evidently refers to that server, not your home computer.