הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
CSC 318 WEB APPLICATION DEVELOPMENT.  Introduction to Server Scripting language  Client VS Server  Introduction to PHP  PHP Files and Syntax  Function.
PHP Overview CS PHP PHP = PHP: Hypertext Preprocessor Server-side scripting language that may be embedded into HTML One goal is to get PHP files.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
INTERNET APPLICATION DEVELOPMENT For More visit:
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
INTERNET APPLICATION DEVELOPMENT For More visit:
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Nael Alian Introduction to PHP
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Server & Client  Client: Your computer  Server: Powerful & Expensive computer. Requires network access.
JavaScript – Quiz #9 Lecture Code:
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Introduction to PHP “PHP is a server-side scripting language designed specifically for the Web. Within an HTML page, you can embed PHP code that will be.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Julian Springer Room 42 Joe Slovo.  W3 schools recommend that you have a basic understanding of HTML and of JavaScript before attempting to grasp PHP.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Introduction to PHP Advanced Database System Lab no.1.
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 supports.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
PHP Open source language for server-side scripting Works well with many databases (e.g., MySQL) Files end in.php,.php3 or.phtml Runs on all major platforms.
Week 4 PHP H ypertext P reprocessor Reference : Official Site :
Server-Side Scripting with PHP ISYS 475. PHP Manual Website
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
CHAPTER 7 Introduction to PHP5 Part II อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
Introduction to PHP Brendan Knight. What is PHP PHP is a general-purpose scripting language originally designed for web development to produce dynamic.
Since you’ll need a place for the user to enter a search query. Every form must have these basic components: – The submission type defined with the method.
 A PHP script can be placed anywhere in the document.  A PHP script starts with  The default file extension for PHP files is ".php".  A PHP file normally.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  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,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
CGS 3066: Web Programming and Design Spring 2016 PHP.
Web Programming with PHP (3) Superglobals, Form & File processing.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
PHP using MySQL Database for Web Development (part II)
Web Database Programming Using PHP
CGS 3066: Web Programming and Design Spring 2017
Introduction to Dynamic Web Programming
Web Database Programming Using PHP
DBW - PHP DBW2017.
Introduction to Web programming
PHP Introduction.
PHP.
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
PHP an introduction.
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Presentation transcript:

הרצאה 4

עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות בכל עדכון

תהליך העיבוד של דף אינטרנט דינמי The web browser builds an HTTP request, and sends it to the relevant web server. If the user submitted data, it will be included in the request. The web server checks the file extension of the requested page. If it is PHP it invokes the PHP interpreter which is running on the web server. The PHP interpreter finds the relevant PHP script from the hard drive, along with any data it needs, and executes the script (it may request data from the database). The script generates an HTML page as output, and sends it to the client as an HTTP response. The response includes the HTML formatting for the page. The web browser (client) receives the HTTP response, and uses the HTML to format and display the page in the web browser. The browser does not know if the page was obtained from a static HTML page or generated using PHP.

PHP  PHP: Hypertext Preprocessor  What is a PHP File?  PHP files can contain text, HTML, CSS, JavaScript, and PHP code  PHP code are executed on the server, and the result is returned to the browser as plain HTML  PHP files have extension ".php"  Example:  Installed as part of WAMP

What Can PHP Do?  Generate dynamic page content  Create, open, read, write, delete, and close files on the server  Collect form data  Add, delete, modify data in your database  Can be used to control user-access  PHP can encrypt data  Send and receive cookies

PHP Syntax  A PHP script can be placed anywhere in the document.  A PHP script starts with :  The default file extension for PHP files is ".php".  A PHP file normally contains HTML tags, and some PHP scripting code.  In PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive.  However; all variable names are case-sensitive.  In PHP, a variable starts with the $ sign, followed by the name of the variable. 

Output to HTML: Echo / print  Echos what is in ” ” to the html.  Any html can be input…  Examples  echo ”hi”;  echo ” ”;  echo” blabla ”;  echo “ alert(‘careful’) ;  There is also a print function:  print "Hello world! ";

Data Types  Variables can store data of different types, they are not declared.  Strings (in single or double quotes) <?php $x = "Hello world!"; $y = 'Hello world!'; ?>  Integers $x = 5985;  For other types:

Conditional Statements     sp sp

Functions  Aside from built in functions, we can write our own: "; echo " = ". sum(7, 13). " "; echo "2 + 4 = ". sum(2, 4); ?>

Arrays  Indexed array: "; } ?>  Associative array (use named keys that you assign to them): "35", "Ben"=>"37", "Joe"=>"43"); echo "Peter is ". $age['Peter']. " years old."; ?>

SuperGlobals  Several predefined variables in PHP are "superglobals“  They are always accessible, regardless of scope  You can access them from any function, class or file without having to do anything special.  The PHP superglobal variables are:  $GLOBALS  $_SERVER  $_REQUEST  $_POST  $_GET  $_FILES  $_ENV  $_COOKIE  $_SESSION

$_GET  PHP superglobal $_GET is used to collect form data.  $_POST is also a superglobal used to collect form data We will learn it later  The file welcome.php:

Form Validation  on.asp on.asp  Self reading…

Working With DB  With PHP, you can connect to and manipulate databases.  Some examples will be given in class document  Others can be found here   And other places…