Introduction to PHPTCNJ – Web Design 2 : Dynamic By Jean Ho Chu Week 01. Jan 19. 2012
This is Dynamic Website ! Fast, Clean, Easy Molds & Frames Contents Diverse results! + =Server side code provides Contents are The html page oftemplates provided by users or what the users see isfrom the server from databases generated!
What is Client ? Server?Client Server• Visible Nature • Invisible God
What is Client ? Server?Client Server• From your computer • From the hosting service• All the user interactions • Never shown directly, happen from the client performs and executes on the browser
What is PHP?• PHP :“Hypertext Preprocessor.”• “Widely used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.” - from www.php.net-
How does PHP act? User From Codin’ for the web Codin’ for the Web, CHARLES WYKE-SMITH
How to use?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" • Can be embedded into<head> lang="en"> HTML page<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Who are you?</title></head><body> • Starts with <?php<?php • Closes with ?>print "Hello";?></body></html>
What is Database?• A database is a collection of tables (made up of columns and rows) that stores information.
What is MySQL?• MySQL : most popular open-source database• Database Management System (DBMS)• Cf ) Oracle and Microsoft’s SQL Serve are also database, and are competitors to MySQL
How to use?• PHP’smysql_query() • $result = mysql_query(SQL command, ➝ database connection);
Why use PHP and MySQL?• Easy to edit and update• Let the users fill in the space (ex : facebook my pages, blogs, etc…)• Save and Access to Database (impossible with html)• and more…All in all, TO MAKE A DYNAMIC WEBSITE