Download presentation
Presentation is loading. Please wait.
Published byAllison Dixon Modified over 9 years ago
1
ITD 3194 Web Application Development Chapter 4: Web Programming Language
2
Introduction to Web Programming Web programming is used to build: –web pages –web sites –web applications Do you know what is the difference between these three??
3
Web Page A document containing text and graphics created with HTML that is part of a group of hypertext documents or resources that can be accessed through a web browser on the internet.
4
Web Site A collection of related web pages found at a single address. A URL serves as the top-level address of a Web site and points to that Web site's home page. That page serves as a reference point, containing pointers to additional HTML pages or links to other Web sites.
5
Web Application A web application is a set of web pages that are generated in response to user requests. The Internet has many different types of web applications, such as - search engines - online stores - auctions - news sites
6
Brief History of PHP PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix. PHP 2 (1995) transformed the language into a Server-side embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc. PHP 3 (1998) added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans. PHP 4 (2000) became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added.
7
Example Code is embedded into HTML. The PHP code is enclosed in special start and end tags that allow you to jump into and out of "PHP mode".
8
Example
9
Different type of Tag (Open and Close) Starting tagEnding tagNotes <?php?>Preferred method as it allows the use of PHP with XHTML <??>Not recommended. Easier to type, but has to be enabled and may conflict with XML ?>Always available, best if used when FrontPage is the HTML editor <%>Not recommended. ASP tags support was added in 3.0.4
10
Getting Started Simple HTML Page with PHP The following is a basic example to output text using PHP. My First PHP Page
11
Getting Started Using conditional statements Conditional statements are very useful for displaying specific content to the user. The following example shows how to display content according to the day of the week.
12
Web structure arrangement Benefits: - Any changes to header or footer only require editing of a single file. This reduces the amount of work necessary for site maintenance and redesign. - Helps separate the content and design for easier maintenance Page 1 Content Page 5 Content Page 3 Content Page 2 Content Page 4 Content Header Footer
13
Comments in PHP Can use 2 type of notation: –/* your block comment start here */ –//line comment What is the purpose of comment
14
Declaring and initializing variable $variable_name=value; Display variable –Use echo $variable_name;
15
Data type Where to put the data type in PHP language No need to declare the data type of variable Data type known by looking at the value
16
Building Expression Arithmetic Operator: $x=10; $y=20; $z = $x + $y;
17
Building Expression Assignment Operator = -=/= += *= Comparison Operator –==>>= –!=<<=
18
Building Expression Logical Operator –&& –|| –!
19
Function DEFINING FUNCTION <?php function name_of_function(parameter) { statement; } ?>
20
Function Calling Function name_of _function(parameter_value);
21
THANKS FOR LISTENING WITHOUT SLEEPING Take Risks in Your Life" If u Win, U Can Lead! If u Loose, U Can Guide!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.