PHP, Databases, and Cookies Dave Pease IDS496 12/2/2003 www.dpease.com/php.

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to Freeware/Shareware Chapter Four Essential Tools for Web Page Authors.
Advertisements

PHP I.
BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
Server-Side vs. Client-Side Scripting Languages
PHP (2) – Functions, Arrays, Databases, and sessions.
PHP CSCE 330 February 6, 2003 Group Members: Antwan B. Phan George Hwang Luat Vu Programming Language Presentation.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
1 Web Wizards Guide To PHP David Lash Chapter 1 Introduction to PHP.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Robofest 2001 Online Management System Jim Needham MCS 4833/01 Senior Project Dr. Chan-Jin Chung, Ph.D.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Web Programming Introduction to PHP COM Objectives To understand what PHP is and how a PHP script works with a Web Browser and a Web Server To learn.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 21: Publishing Your Pages on the Web.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
The PHP Story. PHP Story PHP is a programming language. Incorporate(join) sophisticated business logic. Widely used general purpose scripting language.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
Web Design Scripting and the Web. Books on Scripting.
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.
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 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
With your friendly Web Developer, Chris.. Terminology  HTML - > Hypertext Markup Language  CSS -> Cascading Style Sheet  open tag  close tag  HTTP->Hypertext.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
PHP Professor Waterman. Agenda What is PHP Versions HTML Dynamic Web sites Interactive Web Sites Installing PHP Transfer pages to a Web hosting service.
INTERNET APPLICATION DEVELOPMENT For More visit:
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Multifarious Project Team Members Alberto Dominguez Nirmit Gang Jimmy Garcia Javier Handal.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
CakePHP is an open source web development framework. It follows Model-View- Controller and is developed using PHP. IT is the basic for user to create.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
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.
1 CSC 301 Web Programming Charles Frank. PHP – Stands for:  Personal Home Page (originally),  PHP: Hypertext Preprocessor (now; follows GNU’s recursive.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
An Investigation into using a Document Management System Presented by: Bijal RanaSupervisor: John Ebden.
CSC 405: Web Application Engineering II8.1 Web programming using PHP What have we learnt? What have we learnt? Underlying technologies of database supported.
Chap 2 – Getting Started COMP YL Professor Mattos.
 To start using PHP, you can:  Find a web host with PHP and MySQL support  Install a web server on your own PC, and then install PHP and MySQL.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
CGS 3066: Web Programming and Design Spring 2016 Introduction to Server-Side Programming.
 Lecture  Website language: ASP.net  Book name Beginning ASP.NET 4 in C# and VB 2.
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Introduction to Dynamic Web Programming
CSC 301 Web Programming Charles Frank.
Web Programming Language
PHP / MySQL Introduction
ISC440: Web Programming 2 Server-side Scripting PHP 3
Content of Presentation
IntroductionToPHP Static vs. Dynamic websites
Tutorial 6 PHP & MySQL Li Xu
Web Programming Language
Hypertext Preprocessor
Web Application Development Using PHP
Presentation transcript:

PHP, Databases, and Cookies Dave Pease IDS496 12/2/2003

PHP Basics  Scripting language Non-compiled Similar in operation to Perl Similar in syntax to C Designed for the Web Releases exist for all major operating systems and HTTP servers  MS Windows/MS IIS, Linux/Apache, etc.

PHP Syntax  Server executes anything between as PHP code  # or // for comments  Lines end in semi-colons;  Generally all files with.php extensions are executed Can be changed in HTTP server configurations

PHP and HTML  PHP can be embedded in HTML Anything outside is ignored by PHP but rendered by HTTP server as normal

Passing Arguments to PHP  PHP can read command line arguments No argumentarg=foo

PHP and Forms  PHP can read data from HTML forms Check functions can be easily implemented Select boxes in forms can be populated in loops in PHP HTML page content always displays Utilize PHP’s helpful environmental variables

Databases and PHP  For content-heavy (article based) websites, PHP with a database back-end is an excellent solution Very few scripts and pages to maintain Easy to change features/colors/layout across entire site quickly Database (many articles) Single PHP pageSite visitor

Database types  MySQL Popular, many users, lots of documentation, excellent integration with PHP MyPHPAdmin is a popular, free tool that allows you to administer your MySQL database via the web  PostgreSQL Newer, more features, smaller user base  Both databases: Are free Support SQL instruction set (IDS 480)

Cookies  Information a website can write to a client Client must have cookies enabled in their browser Many legitimate uses  A site can only read a cookie that it put on the client’s computer, so allowing cookies won’t throw your entire hard drive open to unscrupulous websites to invade PHP has built-in support for cookies

Cookie Example: sessiontoken  When a user visits a site, PHP script checks for cookie If it exists, get unique sessiontoken from cookie to check login status in database If it doesn’t exist, create cookie with new sessiontoken and create new row in database Script “included” in every PHP page in site  Regular visitors/site members stay “logged in” and don’t have to re-enter their passwords

Resources  php.net Every PHP function documented  experts-exchange.com Good place to get answers to tough PHP/database questions  google.com Describe what you are trying to do and include the string “PHP” and you will nearly always find the answer documented somewhere on the internet  postgresql.com PostgreSQL database documentation  mysql.com MySQL database documentation  phpmyadmin.net Administrate a MySQL database via the web  oreilly.com Excellent technical books  editplus.com Notepad replacement/script editor; shareware  ~sgtatham/putty/ ~sgtatham/putty/ PuTTY free terminal utility