DATABASE ACCESS CONTROL IST210 1
Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be encoded in every PHP page? Is it safe to put password in many PHP files? NO! IST210 2
Information Required to Access a Database Username Password Database server (database host) Database to access IST210 3
Is User Information Safe Here? Access to the PHP codes PHP practices Access to the database User account management in database server IST210 4
A Separate Authentication File IST210 5 Store information in a separate authentication.php signup.php Use require to include it whenever you need the information
Implement Authentication File in Your Project This will remove a lot of redundancies in duplicate inputs of database information And also it is safety-concerned implementation IST210 6
TRY TWO WEBSITE TEMPLATES IST210 7
Instructions: Step 1 You can download the website templates from course website website website2 Copy and paste two folders in your webspace IST210 8
Instructions: Step 2 Change the following variable values in the authentication.php file $databaseName $sqlusername $sqlpassword Visit Visit IST210 9