Hypertext Preprocessor
Hypertext Preprocessor
Hypertext Preprocessor
HYPERTEXT
PREPROCESSOR
PHP Introduction
PHP Engine –
Run Script
HTML Response PHP Results
User Web Server
PHP Language Basics
• Prefixed with a $
• Assign values with = operator
• Example: $author = “Trevor Adams”;
• No need to define type
• Variable names are case sensitive
– $author and $Author are different
PHP - Constants
> Arithmetic
> Assignment
> Comparison
> Logical
PHP Conditional Statements
•> if statement - use this statement to
execute some code only if a specified
condition is true
•> if...else statement - use this statement
to execute some code if a condition is true
and another code if the condition is false
•> if...elseif....else statement - use this
statement to select one of several blocks of
code to be executed
•> switch statement - use this statement to
PHP Arrays
Notice how the URL carries the information after the file name.
PHP Forms - $_POST Function
•> The built-in $_POST function is used to
collect values from a form sent with
method="post".
•> Information sent from a form with the
POST method is invisible to others and has
no limits on the amount of information to
send.
•> Note: However, there is an 8 Mb max size
for the POST method, by default (can be
PHP Forms - $_POST Function