Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic PHP.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

1 PHP  Introduction to PHP  Basic Syntax of PHP Variables, Constant, Data Type, Type Casting  Getting Data From Client  PHP Database Manipulation.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Arrays.
PHP Week 11 INFM 603. Thinking About PHP Local vs. Web-server-based display HTML as an indirect display mechanism “View Source” for debugging –But not.
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.
PHP Introduction.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Objectives Connect to MySQL from PHP
Website Development & Management PHP Odds & Ends Instructor: John Seydel, Ph.D. CIT Fall
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(26) PHP (Personal Home Page)
Introduction to PHP (Part-1) Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
PHP and MySQL Web Development tMyn1 PHP and MySQL Web Development When you install PHP, you can select from a number of extensions. The MySQL support in.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic DHTML.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
1 CS 482 Web Programming and Scripting Week 6 – Installing Apache, PHP, MySQL and Using the Software.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 26 - PHP Outline 26.1 Introduction 26.2 PHP 26.3 String Processing and Regular Expressions 26.4.
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
The foreach LooptMyn1 The foreach Loop The foreach loop gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error.
Chapter 4: Basics of PHP 42. Topics Introduction Creating and Executing PHP Programs Variables Operators Constant Arrays String Processing and Regular.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 26 - PHP Outline 26.1 Introduction 26.2 PHP 26.3 String Processing and Regular Expressions 26.4.
Chap 3: Web Programming (CCSB144) - PHP 42 Chapter 4 - PHP Outline Introduction PHP String Processing and Regular Expressions Viewing Client/Server Environment.
 2008 Pearson Education, Inc. All rights reserved PHP.
Jozef Goetz contribution, Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
 2003 Prentice Hall, Inc. All rights reserved. 1 PHP Outline 26.1 Introduction 26.2 PHP 26.3 String Processing and Regular Expressions 26.4 Viewing Client/Server.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Lecture 10 – MYSQL and PHP (Part 2)
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
10. Web Servers, SQL & PHP. 2 Motto: Get your facts first, and then you can distort them as much as you please. –Mark Twain.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
CS320 Web and Internet Programming Introduction to PHP Chengyu Sun California State University, Los Angeles.
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.
PHP PHP: Hypertext Preprocesor Personal Home Page Tools.
Intro to PHP Carl-Erik Svensson. What is PHP? PHP is a widely-used general-purpose scripting language that is especially suited for Web development and.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Introduction to PHP Advanced Database System Lab no.1.
Fall 2004CSI University of Ottawa Introduction to PHP Basic principles and syntax.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP & MySQL.
PHP Constructs Advance Database Management Systems Lab no.3.
PHP Database Processing CIS 1715 Web Technologies.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
1 CSC 301 Web Programming Charles Frank. PHP – Stands for:  Personal Home Page (originally),  PHP: Hypertext Preprocessor (now; follows GNU’s recursive.
Introduction to PHP.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
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.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
Fall 2004CSI University of Ottawa Introduction to PHP Basic principles and syntax.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Web Database Programming Using PHP
Chapter 19 PHP Part I Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Chapter 26 - PHP Outline 26.1 Introduction 26.2 PHP
CSC 301 Web Programming Charles Frank.
Web Database Programming Using PHP
23 PHP.
Web DB Programming: PHP
23 PHP.
Presentation transcript:

Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic PHP

Introduction PHP – PHP: Hypertext Preprocessor – Originally called “Personal Home Page Tools” – Popular server-side scripting technology – Open-source Anyone may view, modify and redistribute source code Supported freely by community – Platform independent

PHP Basic syntax – Scripting delimiters Must enclose all script code – Variables preceded by $ symbol Case-sensitive – End statements with semicolon – Comments // for single line and /* */ for multiline – Filenames end with.php by convention

Outline first.php (1 of 1) Declare variable $name Scripting delimiters Single-line comment Function print outputs the value of variable $name

Variables in PHP Data types: Concatenation operator. (period) example :

Operators and Constants Arithmetic operators – Assignment operators Syntactical shortcuts: +=, *=, -= etc. Before being assigned values, variables have value undef Constants – Named values – define function See example at:

Arrays Group of related data Elements Name plus braces and index Indices start at zero – count function – array function – Built-in iterators Maintain pointer to element currently referenced reset key next foreach loops

Connecting to a Database Interacting with databases – SQL Structured Query Language Used to manipulate databases – Several useful functions mysql_connect mysql_select_db mysql_query mysql_error mysql_fetch_row mysql_close

Outline Build the select query and assign the string to variable $query. Function mysql_connect returns a database handle which represents PHP’s connection to a database. If this connection is not made, function die is called to terminate script execution.

Outline Function mysql_select_db is called to specify the database to be queried. Function mysql_query returns an object containing the result set of the query, which we assign to variable $result. The for loop iterates through each record in the result set while constructing an XHTML table from the results. Variable $counter is incremented by one for each row retrieved. Function mysql_fetch_row returns an array containing the elements of each row in the result set of our query ( $result ).

Outline The foreach loop iterates through the array containing the elements of each row and prints out each element in an individual table cell. The total number of results are printed to the client.

Connecting to a Database