My apologies if these topics have been covered before, but I tried a couple of searches and I can't even think of the right search terms to use in order to look for answers in the forum archives. I have 2 questions concerning the "accepted" way to do things in PHP/MySQL.
1) In PHP, you can handle input from an HTML form either by sending it to a separate PHP file or by making the form part of a PHP file which then calls itself to process the form inputs. I've done it both ways in exercises for myself. Is there a consensus on which way is better? Does it matter if the form is a one-shot thing like a registration vs. a repeating event like entering records into a database? Personally, I find that the first way is easier for me to design and code.
2) When writing PHP code that accesses a MySQL database, I've been writing the database login information directly into the PHP code. Is there any reason why I can't or shouldn't have the login stuff in a single .php file, which I then INCLUDE into other PHP files as necessary? Do I need to worry about somehow disguising or encrypting the login information?
Thanks in advance for any replies I get.
-- Jon W.