This document provides an introduction to PHP and MySQL. It covers HTML formatting tags, form elements, GET and POST methods, printing form data, the difference between echo and print, commenting in PHP, PHP case sensitivity, variable declaration rules, and performing mathematical operations. It also discusses formatting text and background colors in HTML and CSS. The next topics to be covered are DIVs, SPANs, PHP variables, and variable naming conventions.
2. What have we done ?
HTML Basic Formatting Tags
Form Elements
Input Types and Buttons
Overview on how to run a PHP Application on
Server
A Simple PHP Application
GET and POST Methods
Print the data of the Forms
Difference between Echo and Print
3. What next ?
Information on Formatting and Coloring
DIV’s and SPAN’s
Commenting in PHP
PHP Case Senstivity
Variable Declaration
Rules for Declaring a variable in PHP
Performing Operations
4. Formatting and Colors
A HTML element has a default style for colors
(background color is white and text color is black).
HTML Style Attibute
style="property : value“ // CSS Values
Set a color for the background
<body style="background-color:lightgrey">
Setting a color for the Text
<h1 style="color:blue">This is a heading</h1>
Setting a text size
<p style="font-size:160%">This is a paragraph.</p>
5. Comments in PHP
It is not executed by the program
It is just for the reference of the developer
Ways to write a comment
Single Line Comments
//
#
Multiple Line Comment
/* _______ */
6. PHP Case Sensitivity
Is PHP really case sensitive ?
No !!
All classes, functions, keywords and user defined
functions are not case sensitive
HOWEVER, Variable names are case sensitive
$hello is different from $Hello
7. Variables in PHP
There is no command to declare a variable
The Declaration of a variable is done by
preceding a “ $ “ sign in front of the desired
variable name
$name
$add
Normal Syntax follows : Strings should be
declared in quotes, numbers without quotes
Variables are used to store and manipulate the
data.
8. Rules for declaring a variable
Variable names are case-sensitive ($age and
$AGE are two different variables)
A variable name cannot start with a number
A variable name should starts with the $ sign,
followed by the desired name of the variable
It is mandatory to start a variable name with a
letter or an underscore character
A variable name can only contain alpha-numeric
characters and underscores (A-z, 0-9, and _ )