Presentation is loading. Please wait.

Presentation is loading. Please wait.

DATABASE ACCESS CONTROL IST210 1. Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be.

Similar presentations


Presentation on theme: "DATABASE ACCESS CONTROL IST210 1. Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be."— Presentation transcript:

1 DATABASE ACCESS CONTROL IST210 1

2 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

3 Information Required to Access a Database Username Password Database server (database host) Database to access IST210 3

4 Is User Information Safe Here? Access to the PHP codes PHP practices Access to the database User account management in database server IST210 4

5 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

6 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

7 TRY TWO WEBSITE TEMPLATES IST210 7

8 Instructions: Step 1 You can download the website templates from course website website website2 Copy and paste two folders in your webspace IST210 8

9 Instructions: Step 2 Change the following variable values in the authentication.php file $databaseName $sqlusername $sqlpassword Visit http://my.up.ist.psu.edu/yourPSUID/website/main.php Visit http://my.up.ist.psu.edu/yourPSUID/website2/main.php IST210 9


Download ppt "DATABASE ACCESS CONTROL IST210 1. Question Almost every PHP page needs to interact with database, does that mean sqlUsername and sqlPassword need to be."

Similar presentations


Ads by Google