08-12-2012, 03:00 PM
PHP
php-26.ppt (Size: 1.59 MB / Downloads: 43)
Introduction
PHP: Hypertext Preprocessor
Originally called “Personal Home Page Tools”
Popular server-side scripting technology
Open-source
Anyone may view, modify and redistribute source code
Supported freely by community
Platform independent
Variables
Can have different types at different times
Variable names inside strings replaced by their value
Type conversions
settype function
Type casting
Concatenation operator
. (period)
Combine strings
String Processing and Regular Expressions
String processing
Equality and comparison two important operations
strcmp function
Returns –1 if string 1 < string 2
Returns 0 if string 1 = string 2
Returns 1 if string 1 > string 2
Relational operators
Form Processing and Business Logic
Business logic
Confirm that valid information was entered
extract function
Creates variables corresponding to each key-value pair in array
Easily retrieve all values sent to PHP page
Regular expressions very helpful
Do checks on client side where possible
JavaScript
Conserves server resources
Ending a script
die function
Remember to close all HTML tags
Verifying a Username and Password
Private website
Only accessible to certain individuals
Encrypt username and password data when sending, storing and retrieving for increased security
Implementing password checking
Login information stored in file
fopen function
Read, write, append modes
Store data using fputs
\n newline character
Close files when done
fclose function