It's been a few years since I did any serious PHP development but you don't have to be a genius to work out that that code is total rubbish. I would suggest that you invest some time into working out how to do this correctly for yourself, or at the very least blacklist the site where you got this code.