Class 12 Notes for Web Scripting

Learning Objectives:

You will be able to identify the differenes between PHP and ASP

You will be able to identify a site that uses dynamically generated websites

You will be able to create a simple PHP webpage.

 

dynamic pages

Homework:

Review: Wikipedia info on ASP and PHP

Review: W3schools PHP site

Create: Dynamically Generated PHP webpage using a database

 

Topics Covered:

 

Codecademy has great tutorials on HTML and PHP

Dynamic (Database Generated) Sites or "Creating Webpages on the Fly"

PhpED Editor that is very easy to use but we will be using Dreamweaver or Notepad ++

 

 

PHP: Pre Hypertext Preprocessor

PHP Declaration  
<?php 
echo "Hello World";
?>
Code block can start anywhere
PHP Variable Declaration  
$txt="Hello World";

All variables in PHP start with a
$ sign symbol and then must have aletter or an underscore

PHP Echo  
echo "Hello World";
echo displays on the screen instead of document.write() for Javascript

 

  • PHP is a server-side scripting language like ASP but is open source (unlike ASP)

  • PHP scripts are executed on the server (like ASP)

  • PHP supports many databases but the database of choice is MySQL because it is open source.

  • PHP has more functionality than ASP because of the open source developer base!

  • PHP runs on Apache and IIS webservers while ASP runs only on IIS.
Any data you obtain for a user, you should filter (validate). PHP has great tools to validate your data


Terms:

ASP, PHP, SQL, Oracle, DB2, Access

 

 

HTML Valid