Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security 

Similar presentations


Presentation on theme: "© 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security "— Presentation transcript:

1 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security  Login / Logout Please Visit: http://www.jandcconsultants.com/school/http://www.jandcconsultants.com/school/ to download all the PowerPoint Slides for the different weeks

2 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 2 Free PHP Hosting Setup First we must setup a hosting account so we can successfully test our PHP code, without a Linux hosted account – our PHP code will not render properly First we must setup a hosting account so we can successfully test our PHP code, without a Linux hosted account – our PHP code will not render properly Lets go to: http://www.zymic.com/zcp/ Lets go to: http://www.zymic.com/zcp/ http://www.zymic.com/zcp/ Please Follow these steps if you do not have a hosting account to upload your PHP files to Please Follow these steps if you do not have a hosting account to upload your PHP files to –Create an account with Zymic –Fill out your login information and the Captcha and Submit your registration –Login in to your account –Click the “Create New Web Host Account” button –Fill out your desired hosting account information for the sub domain for the http://www.vndv.com/ Website (for example, mine is jrod336.vndv.com) http://www.vndv.com/jrod336.vndv.comhttp://www.vndv.com/jrod336.vndv.com –You can now go to the File Manager and Upload your files!

3 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 3 PHP Backend Creating a PHP Backend Creating a PHP Backend –File Structure index.phpindex.php –Main File that processes all commands functions.phpfunctions.php –Contains all functions that will be used for backend uservariables.phpuservariables.php –Will grab all of the information for a user logging into the database and store it definitions.phpdefinitions.php –All Definitions pertaining to the backend variables and files and other information can be housed here

4 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 4 Backend Security & Rules To Create a Backend, one of the most important features to keep in mind is Security. To Create a Backend, one of the most important features to keep in mind is Security. –User Security  Do not allow users to login who do not supply the appropriate credentials requested by the client –Administrators  If there are different types of logins, restrict access to certain parts of the backend to non-Administrators HINT: Define a variable in your ‘users’ table called ‘admin’ and set it to 1 if that person is an administrator, otherwise set it to a default of 0HINT: Define a variable in your ‘users’ table called ‘admin’ and set it to 1 if that person is an administrator, otherwise set it to a default of 0 –Compartmentalization  Do not make database queries (specifically connect strings) easily accesible to users. Usually, change the permissions of the functions.php, definitions.php, and uservariables.php to Read Only. Learn more about changing file access here. here Here are a few general rules to keep in mind when creating your own PHP backend: Here are a few general rules to keep in mind when creating your own PHP backend: –$_SESSION Variables  If you are looking to allow information to saved and stored (you don’t want your user to be prompted to login every page reload) then you will need to store some of these. Make sure to use start_session(); as the first line of your code every time when using $_SESSION VariablesMake sure to use start_session(); as the first line of your code every time when using $_SESSION Variables –Logging  If something is changed or added, make sure to make some sort of documentation of this either in a text log file or in the database –Passing PHP Tokens  You can pass variables information from page to page with PHP by using this naming system after the PHP filename ?var1=value1&var2=value2?var1=value1&var2=value2 You can then retrieve the variables by using $_REQUEST[‘var1']You can then retrieve the variables by using $_REQUEST[‘var1']

5 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 5 Login / Logout Here is the Process for a User who would be logging into their backend of their site: Here is the Process for a User who would be logging into their backend of their site: 1.User would be prompted for credentials at the Login Page 2.If their Login was correct and successfully checked with the database records, then set their $login = 1, and also the users’ $_SESSION[‘login’] = 1 3.If not, you can let them know they can try again –If you want, you can lock them out from potentially logging in if they fail a certain amount of times

6 © 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 6 Your Turn! Create a new folder on your desktop and name it “lastname_firstname” so mine would be “kozel_jared” Create a new folder on your desktop and name it “lastname_firstname” so mine would be “kozel_jared” –Save all of your files associated with your PHP files here Download this zip file to start with here Download this zip file to start with herehere –Unzip all of the files into your folder you just created Open up Adobe Dreamweaver CS3 Open up Adobe Dreamweaver CS3 –You can now open each of the files in Dreamweaver –Start Making the Appropriate Changes to the files Challenges (Let me know if you have questions) Challenges (Let me know if you have questions) –Try to create a user table inside your MySQL database by creating a database through your Web Hosting Panel User Table Should Contain These FieldsUser Table Should Contain These Fields –id (INT 10 PRIMARY auto_increment) –username (VARCHAR 100) –password (VARCHAR 100) –name (VARCHAR 200) –admin (INT 1) –Try to Connect Successfully to your database by changing the function.php file –Create a user in your database for yourself –Login to your User Panel! –Create a Form for General Settings and add the ability to change your name (HINT: look at how the change password function works)


Download ppt "© 2003 By Default! A Free sample background from www.awesomebackgrounds.com Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security "

Similar presentations


Ads by Google