I am new to mySQL and PHP, but have been designing web pages and writing a little perl code for a while. I am getting ready to write my first real database application. All of my books show the username/password hard coded into the php code.
Security wise, is this a good idea? What is the best way to handle this? Shoud the username/password be encrypted in some way and stored in a flat file? If so, what extension and permissions should this file have? Maybe read only, either 644 or 444? This site is hosted on a UNIX server.
Even though the data I'll be storing is not sensitive information (mainly sports schdules/scores, team rosters, and school events), I don't want some hot-shot student (or any other hacker, for that matter) hacking in and messing up my data. I don't understand the security issues very well, other than the fact that I may be more paronoid than I need to be, i.e. I don't understand how access is to my htdocs/cgi-bin files works. I assume that if someone can log on to my site with ws-ftp (like they figured out my username/password), then they can do anything they want, but beyond that, is there any way that a programmer can reasonably defend to keep hackers out of their site/code???
Thanks,
Alisa
🙂