Web Programming Introduction to PHP COM427 1. Objectives To understand what PHP is and how a PHP script works with a Web Browser and a Web Server To learn.
out of 31
Post on 23-Dec-2015
- Slide 1
- Web Programming Introduction to PHP COM427 1
- Slide 2
- Objectives To understand what PHP is and how a PHP script works with a Web Browser and a Web Server To learn what software and components you need to get started with PHP To create and run a simple PHP script COM427 2
- Slide 3
- Web servers Can be considered at two levels: 1.The physical computer that stores web files and web application programs. 2.More precisely, the web server is a specialized piece of software, running on the server computer, which receives requests, via the Internet, for web pages or programs retrieves the pages / executes the programs returns the results over the Internet to the browser. Common web servers: Apache Microsoft Internet Information Services (IIS) COM427 3
- Slide 4
- Web Application Program Carries out many dynamic tasks, such as the following: Input a search term, search the WWW, and return the results Calculate and display the number of times that a page has been viewed Verify the input fields on a Web form Save a Web form into a database Display a special graph, or return the results of a calculation based on data input from a form COM427 4
- Slide 5
- Slide 6
- Basic Browser Web Server interaction 6 1. Browser in Client sents http request e.g. http://localhost/~labuser/test.php 2. Server receives request and activates php to interpret php program (test.php) 3. Server sends html output to browser in client for display
- Slide 7
- PHP Advantages Advantages of Using PHP to enhance Web pages: Easy to use. Open source. Multiple platform. COM427 7
- Slide 8
- Browser PHP MySQL Interaction 8 A third layer can be added if php makes a call to a database to supply data in response to web browser request
- Slide 9
- Browser/PHP/database example 9 Browser holds html form Enter Details of Car Reg Num Make Submit PHP program - Receives values - Plugs them into database query - Sends Request to database - Receives data and - Returns result as web page Details of Car Taxed ? Yes MOT? Yes Reg Date: 1 st Jan 2010 https://www.gov.uk/check-vehicle-tax Car Database
- Slide 10
- Slide 11
- Getting Started with PHP To develop and publish PHP scripts all you need is: A Web server with PHP built into it A client machine with a basic text editor and Internet connection FTP software (if webserver used) Use localhost in the development phase and then upload to the server COM427 11
- Slide 12
- Installation of Apache, PHP and MySQL In the lab: Apache server, PHP, MySQL installed At home: Install Apache, PHP and MySQL separately, Or install Apache, PHP, MySQL together using a package, eg. WAMP or MAMP (for Windows or Mac) XAMPP installs very easily & is cross-platform (Windows or Mac) COM427 12
- Slide 13
- Install Apache, PHP & MySQL Download XAMPP http://sourceforge.net/projects/xampp Installs Apache/PHP/MySQL (plus PERL) Cross platform (Mac/Windows/Linux) COM427 13
- Slide 14
- Using Apache, PHP and MySQL iMAC Lab Save your HTML file (e.g. test.html) or PHP file (e.g. myprog.php) under: Macintosh ID/Users/Labuser/Sites Run html or php file under Apache using: e.g. http://localhost/~labuser/test.html OR create subdirectory starting with b (e.g. student number b00XXXXXX ) http://localhost/~labuser/b00XXXXXX Click on file in browser window Windows Lab/ Own Windows Machine [ Put files in C://xampp/htdocs e.g. hello.php URL to run file http://localhost/hello.php OR create subdirectory and click on browser list] COM427 14
- Slide 15
- Using MySQL http://localhost/phpMyAdmin MAC Lab Login (MySQL) Login: labuser Password: macimd15 Windows Lab login (MySQL) Login: labuser Password: Labuser1 COM42715
- Slide 16
- Creating a PHP Script File You can use a number of different editors to create your PHP script files. TextWrangler (can add line numbers) Save file with.php extension [In Windows Lab can use Notepad++ to create PHP scripts] COM427 16
- Slide 17
View more >
PHP Professor Waterman. Agenda What is PHP Versions HTML Dynamic Web sites Interactive Web Sites Installing PHP Transfer pages to a Web hosting service.
PHP ?· 680!!""! " Bac k Close PHP Programming What isPHP? ¥PHP stands for PHP Hypertext Processor Ñ A recursive deÞnition!! . ¥PHP is a server
Web Technology Introduction to PHP. PHP PHP stands for PHP Hypertext Preprocessor PHP is a Server-Side Web Scripting language, which executes on the web.
Introduction to PHP - ?· Server-Side Web Languages PHP Comparing Server-Side Languages Directory/File…
PHP-MySQL By Jonathan Foss. PHP and MySQL Server Web Browser Apache PHP file PHP MySQL Client Recall the PHP architecture PHP can communicate with a MySQL.
CCS 4370/6370: Web Programming Spring 2013 PHP Basics: Introduction to PHP a PHP file, PHP workings, running PHP. Basic PHP syntax variables, operators,
CSC 405: Web Application And Engineering II 2.1 Web Programming with PHP Introduction to Web programming Introduction to Web programming The programming.
Slide 1-1 CHAPTER 1 Introduction to PHP Objectives To understand what PHP is and how a PHP script works with a Web Browser and a Web Server To learn.
Web Programming Basics of PHP 1. Objectives To learn how to store and access data in PHP variables To understand how to create and manipulate numeric.
COMP519: Web Programming Autumn 2010 PHP Basics: Introduction to PHP a PHP file, PHP workings, running PHP. Basic PHP syntax variables, operators,
PHP: Introduction By Trevor Adams. Topics Covered Server side web programming Client/Server systems Comparison with static HTML PHP - what is it? What.