Powerpoint Templates Page 1 Powerpoint Templates Server Side Scripting PHP.

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

0 - 0.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
PHP File Upload ISYS 475.
Shauvik Roy Choudhary, Alex Orso Georgia Institute of Tech nology.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
CS 22: Enhanced Web Site Design - Week 8Slide 1 of 15 Enhanced Web Site Design Stanford University Continuing Studies CS 22 Mark Branom
UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 3 PHP (2) : Functions, User Defined Functions & Environment Variables.
CookiesPHPMay-2007 : [‹#›] Maintaining State in PHP Part I - Cookies.
UFCE8V-20-3 Information Systems Development 3 (SHAPE HK)
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Addition 1’s to 20.
JavaScript and AJAX Jonathan Foss University of Warwick
Test B, 100 Subtraction Facts
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
PHP and the Web: Session : 4. Predefined variables PHP provides a large number of predefined global variables to any script which it runs also called.
Page 1 PHP, HTML, STATE Achmad Arwan, S.Kom. Page 2 PHP ( PHP: Hypertext Preprocessor) A programming language devised by Rasmus Lerdorf in 1994 for building.
©2009 Justin C. Klein Keane PHP Code Auditing Session 7 Sessions and Cookies Justin C. Klein Keane
Using Session Control in PHP tMyn1 Using Session Control in PHP HTTP is a stateless protocol, which means that the protocol has no built-in way of maintaining.
FILE UPLOADS CHAPTER 11. THE BASIC PROCESS 1.The HTML form displays the control to locate and upload a file 2.Upon form submission, the server first stores.
INTERNET APPLICATION DEVELOPMENT For More visit:
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Week 9 PHP Cookies and Session Introduction to JavaScript.
CSE 154 LECTURE 12: COOKIES. Including files: include include("filename"); PHP include("header.html"); include("shared-code.php"); PHP inserts the entire.
Variables, Operators and Data Types. By Shyam Gurram.
Creating Databases for Web Applications cookie examples lab time: favorites cookies & Sessions class time for group work/questions on projects Next class:
Chapter 8 Cookies And Security JavaScript, Third Edition.
12/3/2012ISC329 Isabelle Bichindaritz1 PHP and MySQL Advanced Features.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
PHP1-1 PHP Lecture 2 Xingquan (Hill) Zhu
Chapter 6 Server-side Programming: Java Servlets
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
COOKIES and SESSIONS. COOKIES A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each.
Server-Side Scripting with PHP ISYS 475. PHP Manual Website
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
PHP A very brief introduction PHP1. PHP = PHP: Hypertext Processor A recursive acronym! PHP scripts are executed on the server side Executed by (a plugin.
 A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
1 PHP HTTP After this lecture, you should be able to know: How to create and process web forms with HTML and PHP. How to create and process web forms with.
NMD202 Web Scripting Week2. Web site
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 3 PHP Advanced.
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
CGS 3066: Web Programming and Design Spring 2016 PHP.
JavaScript and Ajax Week 10 Web site:
PHP WORKSHOP (Session 1) INFO 257 Supplement. Outline What is PHP ? PHP Language Basics PHP Exercise.
Web Programming with PHP (3) Superglobals, Form & File processing.
PHP using MySQL Database for Web Development (part II)
PHP (Session 1) INFO 257 Supplement.
Introduction to Dynamic Web Programming
Tutorial 10 Programming with JavaScript
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
DBW - PHP DBW2017.
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
<?php require("header.htm"); ?>
Lecture 5: Functions and Parameters
Tutorial 10: Programming with javascript
PHP an introduction.
PHP-II.
Presentation transcript:

Powerpoint Templates Page 1 Powerpoint Templates Server Side Scripting PHP

Powerpoint Templates Page 2 Variable

Powerpoint Templates Page 3 The Variable Name •start with the “$” characters •Variable names can consist of characters, numbers and underscore “_” •after the “$” character, must be followed or the underscore character "_“ •are case sensitive Example. •$_name •$first_name •$name3 •$lastName •global $_name Æ variabel global

Powerpoint Templates Page 4 example for using variable Use Variable <?php $Name= "Muhammad"; $NAME= "Zein"; $name= "Zidane"; echo "$Name $NAME $name"; ?>

Powerpoint Templates Page 5 Indirect Variable References •Variables that are named from the contents of other variables. •Created when the script is executed (runtime). Example. $name = "Jhon"; $$name = “Registered User"; Result Registered User

Powerpoint Templates Page 6 Predefinied Variable •The name of variable has been used by PHP. •Some Predefined Variable :  $GLOBAL → Refers to all global variables.  $_SERVER → server environment configuration information.  $_GET → The Variable of GET.  $_POST → The Variable of HTTP POST.  $_FILES → The Variable of HTTP File Upload.  $_REQUEST → The Variable of HTTP Request.  $_SESSION → The Variable of Session  $_COOKIE → The Variable of HTTP Cookie.  $php_errormsg → last error message.  $http_response_header → response from the HTTP Header reques * Superglobals: global variables that include a script file, without having to define global $ variable. Super Global *

Powerpoint Templates Page 7 Predefinied Variable  $GLOBAL •Referring to the global variables in a script. •Array data type.

Powerpoint Templates Page 8 Predefined Variable  $_SERVER •Contains the value associated with server information. •Array data type. •Complete documentation: iables.server.php iables.server.php Example : Results :

Powerpoint Templates Page 9 Predefined Variable  $_GET •Variables from URL parameters. •Array data type.  Example : Create a file with the name predefined_get.php  Access that files in the browser and add the parameter Results : Selamat Datang Tom

Powerpoint Templates Page 10 Predefined Variable  $_POST •Variables derived from the HTTP POST. •Array data type. •Application in HTML Form  Value Properti “name” input elements, to index arrays $_POST  Example, file : form.php  Example, file : input.php

Powerpoint Templates Page 11 Predefined Variable  $_FILES •Variables containing items, uploaded via HTTP POST method. •2-dimensional array of data types •Index Variable $_FILES :  $_FILES[‘foto’][‘name’] → Name of the original file on the client computer.  $_FILES[‘foto’][‘type’] → mime type. Ex : image/gif  $_FILES[‘foto’][‘size’] → file size in byte  $_FILES[‘foto’][‘  $_FILES[‘foto’][‘tmp_name’] → Name of the temporary file that is stored on a server uploaded  $_FILES[‘foto’][‘error’] → Error code that occurred when uploading

Powerpoint Templates Page 12 Predefined Variable  $_COOKIE •Variables derived from HTTP Cookies. •array data type Set cookies on your browser: •setcookie(name, value, expire, path, dom ain, secure, httponly) • cookie.php

Powerpoint Templates Page 13 Predefined Variable  $_SESSION •Variable deriver from session •Array type data Using Session in PHP •session_start() •$_SESSION[‘name’] •session_unset() •session_destroy() •

Powerpoint Templates Page 14 Predefined Variable  $_REQUEST •Contains the value of $_GET, $_POST, dan $_COOKIE •array data type  $php_errormsg •String Type Data

Powerpoint Templates Page 15

Powerpoint Templates Page 16 PHP supported by 8 data type. scalar : •Boolean •Integer •Floating-point •String Compound •Array •Object Khusus •Resources •Null

Powerpoint Templates Page 17 Example 1.Boolean Nilai Boolean Contoh Nilai Boolean $a = TRUE; $b = FALSE; Hasil Eksekusi dengan PHP : <?php $a = TRUE; $b = FALSE; echo "\$a = $a"." "; echo "\$b = $b"; ?>

Powerpoint Templates Page Integer Integer Integer <?php $Harga= 15000; $Jumlah= 5; $HargaTotal = $Harga * $Jumlah; echo "Harga = $Harga"." "; echo "Jumlah = $Jumlah"." "; echo "Harga Total = $HargaTotal"." "; $large_number = ; var_dump ($large_number); echo " "; $large_number = ; var_dump ($large_number); echo " "; var_dump ( 0x ); echo " "; $million = ; $large_number = * $million; var_dump ($large_number); ?>