IDK0040 Võrgurakendused I harjutus 07: PHP: Operators, Switch, Forms Deniss Kumlander.

Slides:



Advertisements
Similar presentations
INTEC CS160 - Jeanine Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 3 Control Structures and Data Files.
Advertisements

Java Control Statements
Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: Moving On..
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
Conditionals – if - else Dr. Sajib Datta
PHP Functions and Control Structures. 2 Defining Functions Functions are groups of statements that you can execute as a single unit Function definitions.
14/11/11.  These words have special meanings in themselves  These should NOT be used as Identifiers.  For example:  Break, do, function, case, else,
Website Development Introducing PHP The PHP scripting language Syntax derives from C, Java and Perl Open Source Links to MySql database.
Tutorial 4 Decision Making with Control Structures and Statements Section A - Decision Making JavaScript Tutorial 4 -Decision Making with Control.
The switch StatementtMyn1 The switch Statement Sometimes there can be a multiple-choice situation, in which you need to execute a particular set of statements.
Introduction to PHP. PHP PHP is the Hypertext Pre-processor –Script language –Embedded into HTML –Runs as Apache module –Can use DB (MySQL, Oracle, Microsoft.
ALBERT WAVERING BOBBY SENG. Week Whatever: PHP  Announcements/questions/complaints.
04/09/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
PHP Tutorial By RAY BALIKI && ROY GHORAYEB. DEFINITION PHP is a powerful server-side scripting language for creating dynamic and interactive websites.
PHP Forms and User Input The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input.
2010/11 : [1]Building Web Applications using MySQL and PHP (W1)PHP Recap.
Programming Methodology and Web Rapid Prototyping (Session 2) TC101, 5 Sessions course, Conducted by Solvith Solvith PHP Course-
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
Open Source Software Unit – 3 Presented By Mr. R.Aravindhan.
CONTROL STRUCTURE The if, elseif, and else & switch Statements 1.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
MS3304: Week 6 Conditional statements. Overview The flow of control through a script Boolean Logic Conditional & logical operators Basic decision making.
PHP Programming with MySQL Slide 4-1 CHAPTER 4 Functions and Control Structures.
Slide 1 PHP Operators and Control Structures ITWA 133.
PHP. What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server.
Julian Springer Room 42 Joe Slovo.  W3 schools recommend that you have a basic understanding of HTML and of JavaScript before attempting to grasp PHP.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Review the following: if-else One branch if Conditional operators Logical operators Switch statement Conditional expression operator Nested ifs if –else.
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
Lesson - 5. Introduction While programming, we usually need to decide the path of the program flow according to the parameters and conditions. Actually.
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
Introduction to PHP Brendan Knight. What is PHP PHP is a general-purpose scripting language originally designed for web development to produce dynamic.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Chapter 5: Intro to Scripting CIS 275—Web Application Development for Business I.
USING CONDITIONAL CODE AMIR KHANZADA. Conditional Statement  Conditional statements are the set of commands used to perform different actions based on.
Unit – 3 Control structures. Condition Statements 1.If.…..else :- Has someone ever told you, "if you work hard, then you will succeed"? And what happens.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
 2006 Pearson Education, Inc. All rights reserved if…else Double-Selection Statement if – Performs action if condition true if…else – Performs.
1 Server Side scripting PHP. 2 What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are.
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
PHP Condtions and Loops Prepared by Dr. Maher Abuhamdeh.
Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.
1 1 إعداد : عبدالرحمن محجوب حمد م 2017 تقنيات الانترنت 2 mtc.edu.sd.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
>> Fundamental Concepts in PHP
Expressions and Control Flow in PHP
CHAPTER 4 DECISIONS & LOOPS
CHAPTER 5 SERVER SIDE SCRIPTING
เอกสารประกอบการบรรยายรายวิชา Web Technology
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Basic PHP Lecture by Nutthapat Keawrattanapat
IF if (condition) { Process… }
Selection CSCE 121 J. Michael Moore.
Programming with PHP Part 2
Flow Control Statements
Logical Operations In Matlab.
JavaScript Part 2.
Decisions, Loops, and Arrays
SELECTIONS STATEMENTS
Relational Operators.
The <script> Tag
Web Programming– UFCFB Lecture 13
PHP PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
PHP CONDITIONAL STATEMENTS
Presentation transcript:

IDK0040 Võrgurakendused I harjutus 07: PHP: Operators, Switch, Forms Deniss Kumlander

PHP Operators + - * / % Modulus (division remainder) ++ Increment: x=5; x++; => x=6 -- Decrement: x=5; x--; => x=4 = += x+=2  x=x+2 - = *= /= %=

PHP Operators Comparison Operators = =is equal to !=is not equal >is greater than <is less than >=is greater than or equal to <=is less than or equal to Logical Operators && || !

Conditional Statements if (condition) code to be executed if condition is true; else code to be executed if condition is false; <?php $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; else echo "Have a nice day!"; ?>

Conditional Statements If more than one line should be executed when a condition is, for example, true: <?php if ($x==10) { echo "Hello "; echo "Good morning "; } ?>

The Switch Statement switch (expression) { case label1: code to be executed if expression = label1; break; case label2: code to be executed if expression = label2; break; default: code to be executed if expression is different from both label1 and label2; }

PHP Form Handling The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts. $_POST $_GET

PHP Form Handling Enter your name: Enter your age: Hello. You said that you are years old! welcome.php abc.html