After studying this chapter you will be able to understand: Operators in PHP, conditional statements in PHP, looping statements, arrays in PHP, super global variables, passing form data, passing data with sessions. | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 3 3 Operators in PHP Arithmetic Operators: +, - ,*, /, %, ** Assignment Operators: = String Operators: . , .= Increment/decrement Operators: ++ , -- Logical Operators: AND, OR, NOT, XOR, &&, ||, ! Comparison Operators: >, = Equality Operators: ==, !=, === Conditional statements if statement - executes some code if one condition is true statement - executes some code if a condition is true and another code if that condition is false statement - executes different codes for more than two conditions switch statement - selects one of many blocks of code to be executed 4 Looping statements For Loop While Loop Do-While Loop ForEach Loop Arrays in PHP Associative arrays Sorting arrays 5 Super Global variables Passing form data Passing data with sessions 6 6 Department of Computer Science, CIIT Islamabad. Forms provide a mean of submitting information from the client to the server. We can create HTML forms using tag Method and action are the most common attributes of 7 action gives the URL of the application that is to receive and process the forms data method sets the HTTP method that the browser uses to send the forms data to the server for processing most common methods are POST or GET 8 When to Use GET? You can use GET (the default method): If the form submission is passive (like a search engine query), and without sensitive information. 9 When to Use GET? When you use GET, the form data will be visible in the page address: 10 Get Method: all Form Data is encoded into the URL, appended the action URL as query string parameters Information is visible to everyone It has the amount limit Get method should only be used when the data is not sensitive Get should not be used when sending passwords or sensitive data 11 12 URL where Information is to be submitted Get Method 13 Getting Name Getting . | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 3 3 Operators in PHP Arithmetic Operators: +, - ,*, /, %, ** Assignment Operators: = String Operators: . , .= Increment/decrement Operators: ++ , -- Logical Operators: AND, OR, NOT, XOR, &&, ||, ! Comparison Operators: >, = Equality Operators: ==, !=, === Conditional statements if statement - executes some code if one condition is true statement - executes some code if a condition is true and another code if that condition is false statement - executes different codes for more than two conditions switch statement - selects one of many blocks of code to be executed 4 Looping statements For Loop While Loop Do-While Loop ForEach Loop Arrays in PHP Associative arrays Sorting arrays 5 Super Global variables Passing form data Passing data with sessions 6 6 Department of Computer Science, CIIT Islamabad. Forms provide a mean of submitting information from the client to the .