Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)

Similar presentations

Presentation on theme: "1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)"— Presentation transcript:

1 1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)

2 PHP is a server side scripting language. Through PHP we can develop dynamic websites. Static Websites: those websites which structure contents are not changing. User’s can’t bring changing to the contents. Dynamic Websites: those websites, whose structure and contents are changing e.g. (user upload pictures, links, videos, comments) User is interacting with the website and change the contents or modify the contents. What is PHP?

3 JavaScript is another example of popular scripting language. Unlike JavaScript, PHP run on server machine, JavaScript run on client machine. Client side = User’s Browser Server side = Web Server Because PHP run on server, so we need a web server to run it on.

4 PHP is designed for use with HTML. –PHP can be embedded with HTML. –PHP return HTML to browser. –PHP code is our input. –Web pages is out output. PHP provides more flexibility than HTML alone because through HTML you can create only static web pages, through PHP you create dynamic web pages. PHP syntax is similar to C, Java and Perl. If you have knowledge of ASP then it will helpful to learn PHP. We can say ASP is Microsoft version of PHP.

5 Why use PHP? You want to know the limits of HTML, and you want to do more. PHP is Open Source/Free Software. (open source means, source code is available for every one for study, use and modify) (free software means its free of cost to download and free to use) PHP is cross platform to develop, to deploy and to use. (means we put PHP on window server, on MAC server or on Linux/Unix server.) PHP is web development specific. PHP can be object oriented, especially version 5.

6 INSTALLATION You will need?  Web Server  PHP  Database  Text Editor  Web Browser

7 Windows Installation All-in-one Packages WAMP: XAMPP:

8 Embedding PHP PHP is embedded in html., tells web server begin and ends the php commands. The server access the webpage, it knows to be ready for php because we have.php extension. Server still needs some extension where php start and stops, with <?php it turned on php, start filtering

9 VARIATION on PHP Short open tags (considered bad form)

10 NOTE We will embed php code in html code. Whenever we embed php code in html, the file extension will always be.php, otherwise if extension will.html. The server treats it the php code as text. PHP code will embed in anywhere of HTML code.

11 STRUCTURE OF BASIC PHP STATEMENT Instruction separator, this is end of this instruction echo is a function, which print something

12 CONCATENATION Dot (.) is used to concatenate two strings

13 13 Case Sensitivity in PHP Programming language constructs in PHP are mostly case insensitive. <?php echo " Explore Africa, "; Echo " South America, "; ECHO " and Australia ! "; ?>

14 The Operational Trail What happens, when you actually ask for a URL in your browser before you get HTML back to you. Browser hp Server Find PageHello.php Return HTML Process PHP Databases Apache

15 COMMENTS IN PHP Single line comments // single line comments are like this # or like this Double line comments /* our double line comment here and we can keep typing and typing */

16 Difference b/w Desktop and Web App Desktop software or app execute only at local system, its extension is.exe Online web apps run when a request reach to server, that request indicate a file on server that web server execute this file and send result back to client’s browser.

Download ppt "1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)"

Similar presentations

Ads by Google