Operator Description Example Result
+ Addition x=2
x+2 4
- Subtraction x=2
5-x 3
* Multiplication x=4
x*5 20
/ Division 15/5
5/2 3
2.5
% Modulus (division remainder) 5%2
10%8
10%2 1
2
0
++ Increment x=5
x++ x=6
-- Decrement x=5
x-- x=4
Assignment Operators
Operator Example Is The Same As
= x=y x=y
+= x+=y x=x+y
-= x-=y x=x-y
*= x*=y x=x*y
/= x/=y x=x/y
.= x.=y x=x.y
%= x%=y x=x%y
Comparison Operators
Operator Description Example
== is equal to 5==8 returns false
!= is not equal 5!=8 returns true
> is greater than 5>8 returns false
< is less than 5<8 returns true
>= is greater than or equal to 5>=8 returns false
<= is less than or equal to 5<=8 returns true
Logical Operators
Operator Description Example
&& and x=6
y=3
(x < 10 && y > 1) returns true
|| or x=6
y=3
(x==5 || y==5) returns false
! not x=6
y=3
!(x==y) returns true
google ads
Tuesday, September 15, 2009
Variable Naming Rules
• A variable name must start with a letter or an underscore "_"
• A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ )
• A variable name should not contain spaces. If a variable name is more than one word, it should be separated with underscore ($my_string), or with capitalization ($myString)
• A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ )
• A variable name should not contain spaces. If a variable name is more than one word, it should be separated with underscore ($my_string), or with capitalization ($myString)
PHP is a Loosely Typed Language
In PHP a variable does not need to be declared before being set.
In the example above, you see that you do not have to tell PHP which data type the variable is.
PHP automatically converts the variable to the correct data type, depending on how they are set.
In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it.
In PHP the variable is declared automatically when you use it.
In the example above, you see that you do not have to tell PHP which data type the variable is.
PHP automatically converts the variable to the correct data type, depending on how they are set.
In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it.
In PHP the variable is declared automatically when you use it.
Basic PHP Syntax
A PHP scripting block always starts with . A PHP scripting block can be placed anywhere in the document.
On servers with shorthand support enabled you can start a scripting block with .
For maximum compatibility, we recommend that you use the standard form (?>
A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
Below, we have an example of a simple PHP script which sends the text "Hello World" to the browser:
Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another.
There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World".
Note: The file must have the .php extension. If the file has a .html extension, the PHP code will not be executed.
On servers with shorthand support enabled you can start a scripting block with .
For maximum compatibility, we recommend that you use the standard form (?>
A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
Below, we have an example of a simple PHP script which sends the text "Hello World" to the browser:
Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another.
There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World".
Note: The file must have the .php extension. If the file has a .html extension, the PHP code will not be executed.
Suggestions:
• Contact a local Non-Profit Corporation and ask them if you can volunteer to create a web site for their organization.
• Create a personal site including your resume and references, information about you (family, interests, hobbies)
• Create a site marketing a fictitious company or product.
• Create a site about your hometown or favorite place to visit, include places to stay, spots to visit, restaurants to dine at and other interesting facts.
• BE CREATIVE!!
Your pages must include the following:
• Section headers - used appropriately • Bold and italic fonts
• Centered text • Paragraphs
• An ordered, unordered, or definition list • Horizontal rules
• Graphic images - Be sure to use height/width and Alt tags on your images. (links to image sites can be found at putertutor.net) Use graphics for navigation buttons. • Links to other pages & external sites
• A table • E-mail links and Navigation bars (that allow you to navigate most/all the pages in your site) at the bottom of every page. Contact information at the bottom of every page.
• Special characters • A form (including JavaScript functions)
• Background & text color (search the web for images or click here)
• CSS - inline, embedded, or linked style sheet (optional). If you use CSS on your site, make sure that your site looks clean in Netscape 4.7. For more info on Netscape and CSS search http://www.tinkertech.net for resources.
While you have not learned about creating your own graphics, you should still take the design principles from the Web Design Workshop and the Non-Designers Workbook into consideration. The site should look professional; it will be a part of your portfolio to show to employers.
• Create a personal site including your resume and references, information about you (family, interests, hobbies)
• Create a site marketing a fictitious company or product.
• Create a site about your hometown or favorite place to visit, include places to stay, spots to visit, restaurants to dine at and other interesting facts.
• BE CREATIVE!!
Your pages must include the following:
• Section headers - used appropriately • Bold and italic fonts
• Centered text • Paragraphs
• An ordered, unordered, or definition list • Horizontal rules
• Graphic images - Be sure to use height/width and Alt tags on your images. (links to image sites can be found at putertutor.net) Use graphics for navigation buttons. • Links to other pages & external sites
• A table • E-mail links and Navigation bars (that allow you to navigate most/all the pages in your site) at the bottom of every page. Contact information at the bottom of every page.
• Special characters • A form (including JavaScript functions)
• Background & text color (search the web for images or click here)
• CSS - inline, embedded, or linked style sheet (optional). If you use CSS on your site, make sure that your site looks clean in Netscape 4.7. For more info on Netscape and CSS search http://www.tinkertech.net for resources.
While you have not learned about creating your own graphics, you should still take the design principles from the Web Design Workshop and the Non-Designers Workbook into consideration. The site should look professional; it will be a part of your portfolio to show to employers.
FINAL PROJECT
Sign-up for an account at brainbench.com and take the HTML 3.2 test. Submit your results to your instructor (be sure to include your name on the results page).
Using what you have learned in the HTML book, the Non-Designer's Web Book, and the Web Design Workshop create your own web site (minimum of EIGHT created pages) and upload it to an account at Tripod or on another server. Place a link from your homework page to your final project. Notify your instructor via email, rwood@cccoe.k12.ca.us, when the site is complete. The site topic might be one of following:
Using what you have learned in the HTML book, the Non-Designer's Web Book, and the Web Design Workshop create your own web site (minimum of EIGHT created pages) and upload it to an account at Tripod or on another server. Place a link from your homework page to your final project. Notify your instructor via email, rwood@cccoe.k12.ca.us, when the site is complete. The site topic might be one of following:
Tutorial 3 – Designing a Web Page
click the Foreground Color box to see an example of a color dialog box. This dialog box can be used to find out the Hex value of an RGB color and visa versa.
EyeDropper is a small software program that determines the RGB and Hex color values of a web page or any other object. Eyedropper is installed on all the systems. Start > Programs > Web Design > EyeDropper
EyeDropper is a small software program that determines the RGB and Hex color values of a web page or any other object. Eyedropper is installed on all the systems. Start > Programs > Web Design > EyeDropper
Complete and Save the Following:
Tutorial 1 – Creating a Web Page
Sessions 1.1 - 1.3 Pp. 1.03 – 1.36, Review Assignments p. 1.37, and Projects 1 - 3 Pp. 1.38 – 1.42
Do not complete the Lab Assignments
ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
Tutorial 2 – Adding Hypertext Links to a Web Page
Sessions 2.1 - 2.3 Pp. 2.01 – 2.32, Review Assignments Pp. 2.32 – 2.33, and Case Problems 1 – 4 Pp. 2.33 – 2.36
ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
Sessions 1.1 - 1.3 Pp. 1.03 – 1.36, Review Assignments p. 1.37, and Projects 1 - 3 Pp. 1.38 – 1.42
Do not complete the Lab Assignments
ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
Tutorial 2 – Adding Hypertext Links to a Web Page
Sessions 2.1 - 2.3 Pp. 2.01 – 2.32, Review Assignments Pp. 2.32 – 2.33, and Case Problems 1 – 4 Pp. 2.33 – 2.36
ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
Creating Web Pages With HTML
(Includes: HTML, CascadiFile management skills are absolutely necessary to create and maintain web sites. Prior to starting the HTML book, review the file management packet provided by your instructor. Complete the HTML tutorial prior to starting the book. If it is not already installed on your machine, ask your instructor to install it.
Step 1: A folder named html will be copied into your user directory with all of the necessary files for the book.
Step 2: The CD that comes with the book will not be needed in class. You can take it home and you can unzip the files in the Data folder on the CD if you want to work at home.
Step 3: Save all files to the HTML folder in the appropriate sub-folder. ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
You will be using TextPad to create your HTML documents. To access TextPad click Start > Programs > Web Design > TextPad. You may also use Xoology Coda (Start > Programs > Web Design > Xoology Coda > Coda. Coda will color code mistakes in your HTML and JavaScript Syntax.
Complete and save ALL Session Work, Review Assignments, Project Work and Case Problems unless otherwise noted. The Lab Assignments are interactive with files found on the CD and may be done at home. Do not do the lab assignments in class.
Some exercises ask you to print pages that you have created, please DO NOT. Do not print your assignments. Upon completion of the book, your instructor will teach you how to upload your pages to the web for review.
Quick Check answers for each session can be found at the end of each tutorial. Case Problems are a test of what you have learned during the tutorial, be sure to review the tutorial prior to asking for assistance.
Additional HTML resources can be found at http://www.putertutor.net or http://www.tinkertech.net use the Site Map to navigate the sites.
ng Style Sheets, JavaScript, DHTML, & Multimedia)
Step 1: A folder named html will be copied into your user directory with all of the necessary files for the book.
Step 2: The CD that comes with the book will not be needed in class. You can take it home and you can unzip the files in the Data folder on the CD if you want to work at home.
Step 3: Save all files to the HTML folder in the appropriate sub-folder. ALL filenames (HTML, JPEG, GIF, etc.) and folders should be eight characters or less and lowercase even if the book indicates otherwise. Be sure to change the filename extension to .htm NOT .txt (which is the default filename extension for text files.)
You will be using TextPad to create your HTML documents. To access TextPad click Start > Programs > Web Design > TextPad. You may also use Xoology Coda (Start > Programs > Web Design > Xoology Coda > Coda. Coda will color code mistakes in your HTML and JavaScript Syntax.
Complete and save ALL Session Work, Review Assignments, Project Work and Case Problems unless otherwise noted. The Lab Assignments are interactive with files found on the CD and may be done at home. Do not do the lab assignments in class.
Some exercises ask you to print pages that you have created, please DO NOT. Do not print your assignments. Upon completion of the book, your instructor will teach you how to upload your pages to the web for review.
Quick Check answers for each session can be found at the end of each tutorial. Case Problems are a test of what you have learned during the tutorial, be sure to review the tutorial prior to asking for assistance.
Additional HTML resources can be found at http://www.putertutor.net or http://www.tinkertech.net use the Site Map to navigate the sites.
ng Style Sheets, JavaScript, DHTML, & Multimedia)
Subscribe to:
Posts (Atom)