Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system,...

58
XAMPP Installation 1

Transcript of Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system,...

Page 1: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

XAMPP Installation

1

Page 2: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

2

Introducing XAMPP

• An integration package containing a number of useful

packages that make it easy to host web sites on various

platforms.

– WAMP or LAMP

• Allow the ease of installation and set up

• Main Page:

http://www.apachefriends.org/en/xampp.html

Apache – MySQL - PHP

Page 3: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

3

Introducing XAMPP (cont.)

Basic packages include system, programming & server software:

•Apache: the famous Web server

•MySQL: the widely-used, free, open source database

•PHP: the programming language

•Perl: the programming language

•ProFTPD: an FTP server

•OpenSSL: for secure sockets layer support

•PhpMyAdmin: for MySQL admin.

Page 4: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

4

XAMPP Installation

• Download XAMPP installer and let the install begin: – Using the installer version is the easiest way to install XAMPP.

– Use default directory for convenience

Page 5: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

There can be some problems

Port 80 (Apache’s default port) can be occupied by

other programs �

5 http://www.apachefriends.org/en/faq-xampp-windows.html

Page 6: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

XAMPP Directories

• XAMPP default installation directory is c:/xampp/

• The directory of interest is “c:/xampp/htdocs/”

and it’s called the webroot (or document root)

– PHP files are put in the webroot (c:/xampp/htdocs/)

– c:/xampp/htdocs/ maps to http://localhost/

• For example, c:/xampp/htdocs/project/script.php maps to

� http://localhost/project/script.php

– If no file is specified, Apache looks for index.php

• For example, c:/xampp/htdocs/project/ maps to �

http://localhost/project/index.php

6

Page 7: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

7

Installation complete!

Page 8: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

8

XAMPP Control Panel

No need to tick for running as “service”

Apache � HTTP Server

MySQL � DBMS

FileZilla � FTP Client

Mercury � SMTP Client

Page 9: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

9

Starting Apache & MySQL

Toggle button

Page 10: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

If the server is up and running, you will get this splash screen. Click on English.

Type http://localhost/ or http://127.0.0.1/

10

Page 11: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Once English is clicked on, the Welcome webpage is shown for XAMPP.

11

Page 12: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

You’re not accessing the WWW but rather a webpage locally hosted on your computer, which is now running as a web server (localhost).

http://localhost/xampp/index.php

12

Page 13: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Click on Status to determine if everything is working correctly.

13

Page 14: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

What you chose to install should be lighted green on this chart

14

Page 15: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

15

Check the “working environment”

Click on phpinfo() to check the working environment.

Page 16: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

From, Tools � phpMyAdmin, we can manage MySQL

16

Page 17: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

17

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 18: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

What is PHP?

• PHP: Hypertext Preprocessor – Server-side scripting language – Creation of dynamic content – Interaction with databases – Can be embedded in HTML – Open source, written in C – First introduced in 1995; at that time PHP stood

for Personal Home Page. – Similar to Perl and C

18

Page 19: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Exercise #1: Hello PHP

• The PHP code is usually in files with extension ".php“

• The PHP code can be nested within HTML code.

<html> <head><title>Hello world page</title></head> <body> Hello HTML! </body> </html>

<html> <head><title>Hello world page</title></head> <body> <?php echo "Hello PHP!"; ?> </body> </html>

<?php denotes start of PHP code

?> denotes end of PHP code

PHP statements must be ended with

a semicolon.

19

Page 20: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Client-side vs. Server-side Script

<html> <head><title>Hello world page</title></head> <body> Hello HTML!<br> <?php echo "Hello PHP!"; ?> </body> </html>

PHP code is never sent to a client’s Web browser; only the HTML output of the processing is sent to the browser.

20

Page 21: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Client-side vs. Server-side Script • HTML code is processed by browsers as web pages are loading.

(client-side) • PHP code is preprocessed by PHP Web servers that parse

requested web pages as they are being passed out to the browser. (Server-side)

• You can embed sections of PHP inside HTML:

• Or, you can call HTML from PHP :

<BODY>

<p>

<?php $test = "Hello World!";

echo $test; ?>

</p>

</BODY>

<?php

echo "<html><head><title>Hello</title>

?> 21

Page 22: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Comments

• You can add comments to the code – Starting with "//", "#" or block in "/*" and "*/" – Only "/*" – "*/" can be used over several lines – Comments are NOT executed

22

Page 23: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

23

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 24: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Variables

• What are variables? • The values stored in computer memory are called

variables. • The values, or data, contained in variables are

classified into categories known as data types. • The name you assign to a variable is called an

identifier.

24

Page 25: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Variables

• Prefixed with a $ (Perl style) • Assign values with = operator • Example: $name = “John Doe”; • No need to define type • Variable names are case sensitive

• $name and $Name are different

25

Page 26: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Variables

• Each variable is declared when it's first assigned value.

• The type of the value determines the type of the variable.

<?php // declare string variable $output $output = "<b>Hello PHP!</b>"; Echo $output; � Hello PHP! ?>

26

Page 27: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

27

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 28: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Variable/Data Types

• A data type is the specific category of information that a variable contains

• Possible PHP Variable Types are: – Numeric (real or integer)

– Boolean (TRUE or FALSE)

– String (set of characters)

28

Page 29: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Variable/Data Types

• Unlike C, PHP is not strictly typed. • PHP decides what type a variable is based on

its value. • PHP can use variables in an appropriate way

automatically • For Example:

• $HST = 0.12; // HST Rate is numeric • echo $HST * 100 . “%”; //outputs “12%”

• $HST is automatically converted to a string for the purpose of echo statement

29

Page 30: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Displaying Variables

• To display a variable with the echo statement, pass the variable name to the echo statement without enclosing it in quotation marks : – $VotingAge = 18;

– echo $VotingAge;

• To display both text strings and variables, you may used concatenation operator “.” :

• echo "<p> The legal voting age is “. $VotingAge. " . </p>";

Concat. operator Period

30

Page 31: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Naming Variables

• The name you assign to a variable is called an identifier

• The following rules and conventions must be followed when naming a variable: • Identifiers must begin with a dollar sign ($) • Identifiers may contain uppercase and lowercase

letters, numbers, or underscores (_). • The first character after the dollar sign must be a letter. • Identifiers cannot contain spaces or special characters. • Identifiers are case sensitive

31

Page 32: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Declaring and Initializing Variables

• Specifying and creating a variable name is called declaring the variable

• Assigning a first value to a variable is called initializing the variable

• In PHP, you must declare and initialize a variable in the same statement: – $variable_name = value ;

32

Page 33: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Strings

• String values – Strings may be in single or double quotes

– Start and end quote type should match – Difference between two types of quotes is the

escape sequences

<? $output1 = "Hello PHP!" ; $output2 = 'Hello again!' ; ?>

33

Page 34: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

$str2 = ' "I \' ll be back ", he said. ' ; echo $str2; � outputs "I'll be back", he said.

Strings escaping

• Special chars in strings are escaped with backslashes (C style)

• Double-quoted string

• Single-quoted string

$str1 = "this is \" PHP\" "; echo $str1; � outputs this is “PHP”

34

Page 35: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Variables in strings • Double quoted strings offer something more:

• Variables are evaluated in double-quoted strings, but not in

single-quoted strings.

• For single-quoted strings, use concatenation:

$saying = "I'll be back!"; $str1 = “He told me: $saying "; outputs � He told me: I'll be back!

$saying = "I'll be back!"; $str3 = ‘He told me: ’ . $saying ; outputs � He told me: I'll be back!

$saying = "I'll be back!"; $str2 = ‘He told me: $saying ’; outputs � He told me: $saying

35

Page 36: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

36

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 37: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Working with user input

• The user sends data to the server only one way – with HTML Forms – They are sets of fields that determine the

types of data to be sent. – The server receives the filled-in data and

sends the HTML response back to the user/ – The forms data is similar to user inputs to a

normal application

37

Page 38: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

How Does It Work

The user enters data and submits the form. The form has "action" URL to send the data to. The user enters data and submits the form. The form has "action" URL to send the data to.

<? echo "Welcome ".$_POST ['username'] ."!"; ?>

<? echo "Welcome ".$_POST ['username'] ."!"; ?>

The PHP script receives the data as $_GET and $_POST arrays and runs.

The PHP script receives the data as $_GET and $_POST arrays and runs.

… <body> Welcome Mike! …

… <body> Welcome Mike! …

Producing HTML according to user's posted data. Producing HTML according to user's posted data.

38

Page 39: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

$_POST and $_GET

• PHP receives the data in the $_GET and $_POST arrays – URL parameters (data from HTML forms with

method=“GET“) go into the $_GET array. – Data from HTML forms with method="post"

go into the $_POST array.

– Both arrays are global and can be used anywhere in the requested page.

39

Page 40: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

$_POST • $_POST is an associative array (key and value pairs)

– The “name” attribute of form input becomes key in the array

– If in the above form the user fills "John" and "mypass“

– test.php will start with built-in array $_POST": • $_POST[“firstname"] will be "John" • $_POST['pass'] will be "mypass"

<form method=" post" action="test.php"> <input type="text" name=“ firstname " /> <input type="password" name=" pass " /> </form>

40

Page 41: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

$_GET

• $_GET is also associative array – If we open the URL:

– The test2.php script will start with built-in

array $_GET • $_GET['page'] will be 1 • $_GET['user'] will be "john"

http://phpcourse.com/test2.php? page=1&user=john

41

Page 42: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

$_POST Versus $_GET

• $_GET passes the parameters trough the URL

– Allows user to send link or bookmark the page as it is.

– Parameters are visible in the URL; security concerns.

– URL is limited to 255 symbols.

• $_POST passes the parameters trough the request body

– More secure; parameters are not visible in the URL.

– Prevent bookmarking; user cannot open the page

without first filling the post data in the form.

– Unlimited size of data. 42

Page 43: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Exercise #2

43

Ex1.html

Thank_You.php

Thank you Test Example! We received your information.

Page 44: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

44

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 45: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Variable Operators • Standard Arithmetic operators • +, -, *, / and % (modulus � the remainder of division of

one number by another, e.g, 5 % 2 = 1 and 9 % 3 = 0 )

• String concatenation with a period (.) • $car = “Hello” . “ World!”;

• echo $car; output “Hello World!”

• comparison operators • Equal � == (double equal sign is a comparison operator) – Using only one equal sign will initialize/overwrite the value of

variables (the assignment operator).

• Not Equal � !=

• Less than � < • greater than � > • Less than or equal � <= • greater than or equal � >=

45

Page 46: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Combined Operators • $a = 3;//Assignment

– Initializes/overwrites $a to 3

• $a += 5; // Combined Assignment

– sets $a to 8 � $a = $a +5

• $a ++; // Increment Operator

– sets $a to 9 � $a = $a +1 � $a += 1

• $a --; // Decrement Operator

– sets $a back to 8 � $a = $a - 1 � $a -= 1

• $a == 5; // Comparison operator

– compares the value of $a to 5, produces false.

• Combined operator for strings – $b = "Hello ";

– $b .= "There!"; // sets $b to "Hello There!";

46

Page 47: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Strict Comparison

• ===, !== operators for strict comparison – different from ==, != – $a="10";$b=10;$a==$b will produce true. – $a="10";$b=10;$a===$b will produce false.

• Strict comparison: $a === $b : – TRUE if $a is equal to $b, and they are of the

same type.

47

Page 48: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

PHP Fundamentals

48

• PHP “Hello World” Example • PHP Variables • Variable Types • Working with User Input

• Variable Operators • Conditional Statements

Page 49: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Conditional Statements

• Decision making or flow control is the process of determining the order in which statements execute in a program

• The special types of PHP statements used for making decisions are called decision-making statements or conditional statements.

49

Page 50: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Conditional Statements

• Decision making involves evaluating Boolean expressions (true / false)

• Initialize $cat_is_hungry = false; If($cat_is_hungry == true) { /* feed cat */ }

If($cat_is_hungry) { /* feed cat */ }

• AND and OR for combinations if($cat_is_hungry AND $havefood) {/* feed cat*/}

50

Page 51: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Conditional Statements - if • if statement allows code to be executed only if

certain condition is met

– Can we write this code block as one statement?

$a = 5; $b = 7; if ($a > $b) echo "A is greater than B";

if ($a % 2) { echo "A is odd"; $b = $a % 2; echo "A%2 is :".$b; }

if ($b = $a%2) echo "A is odd - A%2 is :".$b;

Boolean expression

If ($a % 2) is true (i.e., = 1), this entire code block will be executed. Code blocks must start and end with opening

and closing braches { }

Don't forget the brackets!

51

Page 52: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

If - else

• if -else statement allows you to execute one code if condition is met or another if not.

• An else clause executes when the condition in an if...else statement evaluates to FALSE

$a = 5; $b = 7; if ($a > $b) echo "A is greater than B"; else echo "B is greater or equal to A";

52

Page 53: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

if - elseif

• if – elseif is an extension to the if -else statement – Allows you to add conditions for the else body

– You can have multiple elseif statements

if ($a > $b) echo "A is greater than B"; elseif ($a == $b) echo "A is equal to B"; else echo "B is greater than A";

53

Page 54: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Nested if

• When one decision-making statement is contained within another decision-making statement, they are referred to as nested decision-making structures

if ($ SalesTotal >= 50)

if ($ SalesTotal <= 100 )

echo " <p>The sales total is between 50 and 100 , inclusive.</p> ";

54

if ($SalesTotal >= 50 && $SalesTotal <= 100)

Page 55: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

55

if ($mark>= 80) echo "A"; if ($mark >= 65) echo “B"; if ($mark >= 50) echo “C"; else echo “F";

A � 80-100% B � 65- 79% C � 50- 64% F � 0- 49%

if ($mark >= 80) echo "A"; elseif ($mark >= 65) echo “B"; elseif ($mark >= 50) echo “C"; else echo “F";

if ($mark >= 80 && $mark < 100) echo "A"; if ($mark >= 65 && $mark < 80) echo “B"; if ($mark >= 50 && $mark < 65) echo “C"; else echo “F";

What will happen when $mark=85 $mark=75

Page 56: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Exercise #3

56

Ex1_c.html

Thank_You.php

Page 57: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

Important Links– CISC:492

Learning without feedback is like learning archery in a darkened room. (Cross, 1996)

Feedback Form http://goo.gl/nWchh Slides are adapted from: http://schoolacademy.googlecode.com/svn/trunk/ http://rizki.staff.ub.ac.id/category/web-programming/

57

Page 58: Tutorial # 2 - XAMPP - To Be Sent.ppt · 3 Introducing XAMPP (cont.) Basic packages include system, programming & server software: •Apache : the famous Web server •MySQL : the

58