php

31
PHP

Upload: tuan-ngo

Post on 10-May-2015

267 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Php

PHP

Page 2: Php

What is HTML?

Page 3: Php

HyperText Markup Language (HTML) is the main markup language for web pages

Page 4: Php

Why HTML?

Page 5: Php

What is CSS?

Page 6: Php

Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of HTML

h1 { color: white; background-color: orange; } h2 { color: white; background-color: green; }

Page 7: Php

Why CSS?

Page 8: Php

Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of HTML

h1 { color: white; background-color: orange; } h2 { color: white; background-color: green; }

Page 9: Php

What is Javascript?

Page 10: Php

JavaScript is a scripting language

function sum() {

var i, x = 0; for (i = 0; i < arguments.length; ++i) { x += arguments[i]; } return x; }

Page 11: Php

Why Javascript?

Page 12: Php

HTML provides only one way communication

Hey, are you

there?

Why the hell don’t you talk to

me?

Page 13: Php

HTML is static and boring.

Page 14: Php

With pure HTML web pages, the server simply serves up static HTML that can only display content.

Page 15: Php

Okay, PHP brings web pages to life

With a little help from the server

Page 16: Php
Page 17: Php

#webpage

#static_page

#dynamic_page

#form

Page 18: Php

PHP Syntax <html> <body> <?php echo "Hello World"; ?> </body> </html>

Page 19: Php

String <?php $txt="Hello World"; echo $txt; ?> Concatenation Operator <?php $txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; ?>

strlen() strlen("Hello world!")

strpos strpos("Hello world!","world");

Page 20: Php

Function function functionName() { echo(“Hello world”); }

Page 21: Php

Use PHP to access form data

Page 22: Php

PHP scripts must live on a server

Page 23: Php

A variable is a container that you can store data in.

Page 24: Php
Page 25: Php

Arithmetic Operators

Page 26: Php

Assignment Operators

Page 27: Php

Comparison Operators

Page 28: Php

Logical Operators

Page 29: Php

If … else

Page 30: Php

Array Numeric Arrays $cars=array("Saab","Volvo","BMW","Toyota");

Associative Arrays $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34);

Page 31: Php

For loops for ($i=1; $i<=5; $i++) { echo "The number is " . $i . "<br />"; }