Sunday, June 21, 2009

Introduction to PHP & MySQL

PHP Training Overview
MySQL™ and PHP are two of the most popular open source technologies to emerge during the past decade. PHP is a powerful language for writing server-side Web applications. MySQL is the world's most popular open source database. Together, these two technologies provide you with a powerful platform for building database-driven Web applications.
This hands-on MySQL and PHP training course teaches attendees everything they need to successfully build data-driven Web sites using MySQL and PHP.
Accelebrate also offers an Advanced PHP training class.
Important Note: Upon request, we would be glad to teach this course with a database other than MySQL.
Location and Pricing
Most Accelebrate courses are taught on-site at our clients' locations worldwide for groups of 3 or more attendees and are customized to their specific needs. Please visit our client list to see organizations for whom we have recently delivered training. These courses can also be delivered as live, private online classes for groups that are geographically dispersed or wish to save on the instructor’s or students’ travel expenses. To receive a customized proposal and price quote private training at your site or online.
In addition, some courses are available as live, online classes for individuals. To see a schedule of online courses.
PHP Training Prerequisites
All MySQL and PHP training attendees must be fluent in HTML. The course can be customized to any level of programming and relational database familiarity.
Hands-on/Lecture Ratio
This MySQL and PHP training class is 70% hands-on, 30% lecture, with the longest lecture segments lasting for 10 minutes. Students "learn by doing," with immediate opportunities to apply the material they learn to real-world problems.
PHP Training Materials
All MySQL and PHP training students receive a copy of Apress' Beginning PHP and MySQL 5: From Novice to Professional and related courseware.
Software Needed on Each Student PC
The following should be installed on each student PC:
Linux, Windows, MacOS X, or Solaris operating system
Web server (either Apache httpd or Microsoft IIS)
PHP 5 or later with the PEAR extensions enabled
MySQL 4.1 or later (5 or later recommended)
Internet Explorer 6 or later or Firefox 2 or later
Note: XAMPP, provides a single installer with everything you need for the class on Linux, Windows, MacOS X, or Solaris.
PHP Training Objectives
*To teach attendees the PHP programming skills they need to successfully build interactive, data-driven sites
*To teach students enough MySQL database skills to build the databases that will power their sites
PHP Training Outline
*PHP Basics
How PHP Works
The php.ini File
Basic PHP Syntax
*PHP Tags
*PHP Statements and Whitespace
*Comments
*PHP Functions
*Hello World!

PHP Tags
PHP Statements and Whitespace
Comments
PHP Functions
Hello World!
Variables
*Variable Types
*Variable Names (Identifiers)
*Type Strength
*Hello Variables!
*Variable Scope
*Superglobals
*Constants
*Variable-Testing and Manipulation Functions

Variable Types
Variable Names (Identifiers)
Type Strength
Hello Variables!
Variable Scope
Superglobals
Constants
Variable-Testing and Manipulation Functions
PHP Operators
Creating Dynamic Pages
*Single Quotes vs. Double Quotes
*Howdy World!

Single Quotes vs. Double Quotes
Howdy World!
Conclusion
*Flow Control
Conditional Processing
*If Conditions
If Conditions
Loops
*while
*do...while
*for
*break and continue
while
do...while
for
break and continue
Conclusion
*Arrays
Enumerated Arrays
*Initializing Arrays
*Appending to an Array
*Reading from Arrays
*Looping through Arrays

Initializing Arrays
Appending to an Array
Reading from Arrays
Looping through Arrays
Associative Arrays
*Initializing Associative Arrays
*Reading from Associative Arrays
*Looping through Associative Arrays
*Superglobal Arrays

Initializing Associative Arrays
Reading from Associative Arrays
Looping through Associative Arrays
Superglobal Arrays
Two-dimensional Arrays
*Reading from Two-dimensional Arrays
*Looping through Two-dimensional Arrays

Reading from Two-dimensional Arrays
Looping through Two-dimensional Arrays
Array Manipulation Functions
Conclusion
PHP and HTML Forms
HTML Forms
*How HTML Forms Work
*A Sample HTML Form
*Form Variables

How HTML Forms Work
A Sample HTML Form
Form Variables
Conclusion
*String Manipulation
Formatting Strings
*Concatenation
*String Manipulation Functions
*Examples of String Functions

Concatenation
String Manipulation Functions
Examples of String Functions
Magic Quotes
*magic_quotes_gpc
*magic_quotes_runtime
*Recommendation on Magic Quotes
*Conclusion

magic_quotes_gpc
magic_quotes_runtime
Recommendation on Magic Quotes
Conclusion
*Reusing Code and Writing Functions
Including Files
*require
*require_once
*auto_prepend_file and auto_append_file

require
require_once
auto_prepend_file and auto_append_file
User Functions
*Defining and Calling Functions
*Default Values
*Variable Scope
*By Reference vs. By Value

Defining and Calling Functions
Default Values
Variable Scope
By Reference vs. By Value
Form Processing
*Code Organization
Code Organization
Conclusion
*Simple SELECTs
Introduction to the Northwind Database
Some Basics
*Comments
*Whitespace and Semi-colons
*Case Sensitivity

Comments
Whitespace and Semi-colons
Case Sensitivity
SELECTing All Columns in All Rows
SELECTing Specific Columns
Sorting Records
*Sorting By a Single Column
*Sorting By Multiple Columns
*Sorting By Column Position
*Ascending and Descending Sorts

Sorting By a Single Column
Sorting By Multiple Columns
Sorting By Column Position
Ascending and Descending Sorts
The WHERE Clause and Operator Symbols
*Checking for Equality
*Checking for Inequality
*Checking for Greater or Less Than
*Checking for NULL
*WHERE and ORDER BY
Checking for Equality
Checking for Inequality
Checking for Greater or Less Than
Checking for NULL
WHERE and ORDER BY
The WHERE Clause and Operator Words
*The BETWEEN Operator
*The IN Operator
*The LIKE Operator
*The NOT Operator

The BETWEEN Operator
The IN Operator
The LIKE Operator
The NOT Operator
Checking Multiple Conditions
*AND
*OR
*Order of Evaluation

AND
OR
Order of Evaluation
Conclusion
*Subqueries, Joins and Unions
Subqueries
Joins
*Table Aliases
*Multi-table Joins
Table Aliases
Multi-table Joins
Outer Joins
Unions
*UNION ALL
*UNION Rules

UNION ALL
UNION Rules
Conclusion
*Inserting, Updating and Deleting Records
INSERT
UPDATE
DELETE
Conclusion
Managing Data
Querying a Database
*mysqli() Overview
*mysqli Methods and Properties
*Inserting and Updating Records
*mysqli Prepared Statements

mysqli() Overview
mysqli Methods and Properties
Inserting and Updating Records
mysqli Prepared Statements
*PEAR:DB
Advantages and Disadvantages of PEAR DB
*Why use a database abstraction layer?
*When not to use a database abstraction layer?
Why use a database abstraction layer?
When not to use a database abstraction layer?
Using PEAR DB
*Authentication with PHP and SQL
A Database-less Login Form
Conclusion
*Regular Expressions
Perl-compatible Regular Expression Functions
*preg_match()
*preg_replace()
*Regular Expression Tester

preg_match()
preg_replace()
Regular Expression Tester
Regular Expression Syntax
*Start and End ( ^ $ )
*Number of Occurrences ( ? + * {} )
*Common Characters ( . \d \D \w \W \s \S )
*Grouping ( [] )
*Negation ( ^ )
*Subpatterns ( () )
*Alternatives ( )
*Escape Character ( \ )

Start and End ( ^ $ )
Number of Occurrences ( ? + * {} )
Common Characters ( . \d \D \w \W \s \S )
Grouping ( [] )
Negation ( ^ )
Subpatterns ( () )
Alternatives ( )
Escape Character ( \ )
Form Validation Functions with Regular Expressions
Conclusion
*Session Control and Cookies
Sessions
*Configuring Sessions
*Session Functions
Configuring Sessions
Session Functions
Cookies
Conclusion
*Sending Email with PHP
mail()
*Shortcomings of mail()
Shortcomings of mail()
PHPMailer
Conclusion
*File System Management
Opening a File
*fopen()
fopen()
Reading from a File
*fgets()
fgets()
Writing to a File
*fwrite()
fwrite()
File Locking
*flock()
flock()
Uploading Files via an HTML Form
Getting File Information
More File Functions
Directory Functions
*Getting a Directory Listing
Getting a Directory Listing
*Conclusion

Advanced PHP Training

Advanced PHP Training Overview
Accelebrate's Advanced PHP training teaches experienced PHP developers the object-oriented, XML, PHP, web services, Ajax, and Smarty skills they need to build complex, data-driven, scalable applications.
Location and Pricing
Most Accelebrate courses are taught on-site at our clients' locations worldwide for groups of 3 or more attendees and are customized to their specific needs. Please visit our client list to see organizations for whom we have recently delivered training. These courses can also be delivered as live, private online classes for groups that are geographically dispersed or wish to save on the instructor’s or students’ travel expenses. To receive a customized proposal and price quote private training at your site or onlin.In addition, some courses are available as live, online classes for individuals. To see a schedule of online courses.
Advanced PHP Training Prerequisites
All attendees must be familiar with the fundamentals of building data-driven PHP web applications, either from their own experience or from Accelebrate's Introduction to PHP and MySQL training.
Hands-on/Lecture Ratio
This PHP training class is 70% hands-on, 30% lecture, with the longest lecture segments lasting for 10 minutes. Students "learn by doing," with immediate opportunities to apply the material they learn to real-world problems.
Advanced PHP Training Materials
All attendees receive comprehensive courseware and a copy of O'Reilly's PHP Cookbook.
Software Needed on Each Student PC
The following should be installed on each student PC:
Linux, Windows, MacOS X, or Solaris operating system
Web server (either Apache httpd or Microsoft IIS)
PHP 5.2 or later with the PEAR extensions enabled
MySQL™ 4.1 or later (5 or later recommended), Microsoft SQL Server 2005, Microsoft Access 2000 or later, or Oracle 8i or later
Internet Explorer 6 or later or Firefox 2 or later
Advanced PHP Training Objectives
Learn how to program in Object-Oriented PHP
Learn to process XML with PHP
Learn to work with the PEAR HTTP_REQUEST Module
Learn to work with XML RPC and PHP
Learn to create PHP Web Services
Learn to work with Smarty Templates to speed up PHP development
Advanced PHP Training Outline
*Object-Oriented PHP
Building a Class
Working with Properties and Functions
Private, Protected, Public modifiers
Inheritance
Interfaces
Building a Web Page Object
PHP Objects in N-Tier Web Architecture
Importance of PHP Business Objects
*PHP XML Support
Simple XML Object
Executing XPath Queries
DOM Interoperability
Using XPath
Installing and Configuring LIBXSL
Applying Server side XSL Transformations
Using XML in N-Tier Architecture
Mixing PHP Objects and XML
*PEAR: HTTP_REQUEST MODULE
Installing PEAR::HTTP_REQUEST with Dependencies
HTTP_REQUEST Capability
HTTP GET Request
HTTP POST Request
Programmatically Posting to a HTML Form
Parsing the Response
Building a Basic Authentication PHP Client
*XML RPC
XML-RPC Implementations
Installing and Configuring PHPXMLRPC
XML RPC Data-Types
XML RPC Server
XML RPC Client
XML RPC Request and Response
Exploring the XML RPC API
*PHP Web Services
Web Service Technulogy Stack
SOAP Soup
Web Services with PHP
Installing NuSOAP
Building a SOAP SERVER
Consuming a Web Service
Generating WSDL Dynamically
Understanding Generated WSDL
WSDL and SOAP Proxies
*Complex PHP Web Services
Building Interoperable Web Services
Generating and Handling SOAP Faults
RPC Vs. Document Message Encoding
Serializing the SOAP Envelope
Web Service Best Practices
*Ajax with PHP
Ajax Overview
Ajax Technulogy Stack
Ajax Implementations
Installing and configuring HTML_Ajax Pear Module
Ajax Server
Ajax Client
*Smarty Templates
Smarty Overview
Installing and configuring Smarty Pear Module
Setting up a Template
Passing Data to the Template
Smarty for Template Designers
Smarty for Programmers
Smarty in N-Tier Architecture
*Conclusion

Building Data-Driven PHP Web Sites with Dreamweaver Training

PHP with Dreamweaver Training Overview
Accelebrate's Building Data-Driven PHP Web Sites with Dreamweaver training class teaches attendees the Dreamweaver and PHP skills they need to integrate databases with their Web site.
Location and Pricing
Most Accelebrate courses are taught on-site at our clients' locations worldwide for groups of 3 or more attendees and are customized to their specific needs. Please visit our client list to see organizations for whom we have recently delivered training. These courses can also be delivered as live, private online classes for groups that are geographically dispersed or wish to save on the instructor’s or students’ travel expenses. To receive a customized proposal and price quote private training at your site or online.
In addition, some courses are available as live, online classes for individuals.
PHP with Dreamweaver Training Prerequisites
Accelebrate's Beginning Macromedia Dreamweaver 8, Introduction to Adobe Dreamweaver CS3, or equivalent experience.
Alternative Class
If you are interested in learning PHP programming, we encourage you to consider our Introduction to PHP & MySQL training class.
Hands-on/Lecture Ratio
This Dreamweaver training class is 70% hands-on, 30% lecture, with the longest lecture segments lasting for 15 minutes. Students "learn by doing," with immediate opportunities to apply the material they learn to real-world problems.
PHP with Dreamweaver Training Materials
All students for this Dreamweaver training class receive a copy of Macromedia Press' Macromedia Dreamweaver with ASP, ColdFusion, and PHP: Training from the Source and related courseware.
Software Needed on Each Student PC
Firefox 2.0 or later or Internet Explorer 6 or later
Dreamweaver 8, CS3, or later (course can also be taught using Dreamweaver MX 2004 or MX)
Microsoft Internet Information Server, Apache Web server, Tomcat, or another appropriate Web server software package.
A database server, such as MySQL™ (free), SQL Server, or Oracle (this can be installed on each student PC or on a server reachable over the network from these PCs)
PHP with Dreamweaver Training Objective
To learn how to build data-driven Web sites using Dreamweaver, PHP, and a database
PHP with Dreamweaver Training Outline
*Introduction
Roles of server-side languages
Choosing a server-side language
Which server-side language is best?
Overview of PHP and its requirements
Goals of this class / Who is this class for?
*Creating a Dreamweaver site
Site creation - basic
Site creation - advanced
*Database connections
Database basics
Introduction to SQL
Server behaviors
*Querying the database
Building a SQL query using the Simple view
Building a SQL query using the Advanced view
Adding fields from the resulting records to your page
*Displaying and formatting query results
Using Repeat Region to display multiple records
Formatting results
*Paging through records
Schemes for recordset navigation
Paging to first, last, previous, and next records
*Show region if...
Selectively displaying information based on a conditional
Disabling the first and previous record links if the first page of results is displayed
Disabling the last and next record links if the last page of results is displayed
*Displaying the count of the number of records returned
*Creating master-detail views

Overview of the importance of master-detail views and how they convey information
Creating a master-detail view
*Advanced recordsets and multi-table queries
Method 1 - Simple recordset with filter
Method 2 - Advanced recordset
Method 3 - Advanced recordset and multi-table Queries
*Dynamically populating forms
Populating text fields, text areas, and hidden fields
Populating selection lists, radio button lists, and checkboxes
*Building record insertion forms
Building the insertion form by hand
Allowing Dreamweaver to generate the record insertion form automatically
Creating a page that confirms the record insertion
Validating form entries using JavaScript behaviors
*Understanding stored procedures
How they are created in the database
Advantages/disadvantages of stored procedures versus SQL
Calling a stored procedure without passing parameters
Passing input parameters to a stored procedure
Retrieving parameters from a stored procedure
*Updating records
Manually constructing a form that allows the user to update a record
Using Dreamweaver to automatically generate a form for updating the record
Validating the edited information using JavaScript behaviors
Building a confirmation page to display the result of updating the record
*Deleting records
Precautions to take to ensure that records are not inadvertently deleted
Building an appropriate record deletion interface, complete with confirmation dialog
*Implementing user login/logout with Dreamweaver
Overview of Web application security issues
Preferred approach: configuring the Web server to manage security
Alternative approach: having Dreamweaver automatically generate code for logging users in, authenticating them, and logging them out
In-depth instruction on using Dreamweaver with PHP to implement user login/logout and page-by-page authentication
*Conclusion

Thursday, June 18, 2009

Browser detection with php

This tutorial explains how to make a code only works in one separated browser, I think that's useful to correct incompatibility of page style in some browsers.

In your page, put:

1.2.
3.$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
4.if(strpos($user_agent, 'Opera') !== false)
5.{
6. echo 'code for Opera';
7.}
8.elseif(strpos($user_agent, 'Gecko') !== false)
9.{
10. echo 'code for Mozilla/Firefox';
11.}
12.elseif(strpos($user_agent, 'MSIE') !== false)
13.{
14. echo 'code for IE';
15.}
16.else
17.{
18. echo 'some other browser';
19.}
20.
21.?>

mySQL Grant Command

You can use the mySQL GRANT command to give priveledges to users to a specific database.
The syntax is as follows and follows the standard mySQL keywords and syntax you would perhaps use in a PHP script.
Code: [hide]
Code: [show]
GRANT privileges
ON databasename.tablename
TO username#host
IDENTIFIED BY "password";
The priveledges you can grant to a user are vast and for added security, you should only grant permissions to a users on a database that are requried by your application:
*ALL (all privileges)
*ALTER
*CREATE
*DELETE
*DROP
*FILE
*INDEX
*INSERT
*PROCESS
*REFERENCES (not used currently)
*RELOAD
*SELECT
*SHUTDOWN
*UPDATE
*USAGE (can connect but no privileges)
*Example use of the above syntax and privileges:
*Code: [hide]
*Code: [show]
GRANT SELECT, INSERT
ON mydatabase.*
TO user#domain.com
IDENTIFIED BY "somepassword"
The above wildcard (*) will replace the entire list of tables in the database. You can specify just specify one table name if required. You can also specify an IP Address for the domain part of the "TO" command.
You can revoke privileges using the following syntax:
Code: [hide]
Code: [show]
REVOKE privileges
ON databasename.tablename
FROM username#hostname
Usually, only server administrators should worry about this kind of permission configuration. If you are a normal webmaster using a typical control panel such as Cpanel - all this is done behind the scenes and you will not need to worry about setting up such code.

PHP Operators

Introduction
An operator is used to operate on values. In a basic example, we use an addition operator to add 1+9 together. In another basic example, we use a subtract operator to take away 1 from 10 (10-1). PHP Operators are split into the following categories and shall be explained later in the article:
*Arithmetic Operators
*Assignment Operators
*Comparison Operators
*Logical Operators
Arithmetic Operators
1.Addition (+), eg: x+y
2.Subtraction (-), eg: x-y
3.Multiplication (*), eg: x*y
4.Division (/), eg: x/y
5.Modulus (%), eg: x%y
6.Increment (++), eg x++
7.Decrement (--), eg y--
Assignment Operators
1. =, eg: x=y
2. +=, eg: x+=y, AKA: x=x+y
3. -=, eg: x-=y, AKA: x=x-y
4. *=, eg: x*=y, AKA: x=x*y
5. /=, eg: x/=y, AKA: x=x/y
6.%=, eg: x%=y, AKA: x=x%y
Comparison Operators
1.Not equal to (!=), eg: 18!=13 returns true
2.Greater than (>), eg: 18>13 returns true
3.Less than (<), eg: 18<13 returns false
4.Greater than or equal to (>=), eg: 18>=13 returns true
5.Less than or equal to (<=), eg: 18<=13 returns false
Logical Operators
1.And (&&), eg: (1<2>4) returns true
2.Or (), eg: (1==5 2==10) returns false
3.Not (), eg: !(5==10) returns true
Conclusion
Operators are mainly seen during assignment of a value to a variable or during a conditional statement or a looping structure. They are very powerful are can be used to determine the output of a script, procedure or function to be run.

Looping with PHP and for()

Introduction
The for() function is an iterative function. The word iteration is basically a posh word for looping. You use looping to avoid spaghetti code, and generate a list of output without having to type it all manually. For example, a looping function, for() can be used to loop the 10 times table without having to type it all out manually. Of course, there are much more practical uses for for(), but this tutorial is to tell you how to use this function so you can integrate it into your own projects.
The function
for() loop is used to loop for a set number of iterations. The function takes the following syntax. The following syntax illustrates the function using pseudo code.
Code: [hide]
Code: [show]
for ( initialize a counter; conditional statement; increment a counter)
{
do this code;
} 'initialize a counter' is used to set a start value for the loop. For example, we want to stop looping from the value 0, we set the initialisation counter as 0. 'conditional statement' is used to set a stop value for the loop. This is usually in the form of a conditional statement or in the form of a set value. Thinking about it as a stop value, we can set this to 10. 'increment a counter' is used to set the amount to increment each iteration. For example, we could set the for() loop to increment + 2 each iteration, or + 1 each iteration (in which cause you would use ++ operand). Example Code
The following is an example use of for().
Code: [hide]
Code: [show]
$num = 10;
for ($i = 0; $i <= $num; $i++)
{
echo $i;
} The above code will increment +1 each iteration, from a start value of 0 to a stop value of 10. On each iteration $i is echoed. The second parameter 'conditional statement' can take many forms such as sizeof($bla) and count($bla).
Optimisations
In the previous section, it was mentioned that you can use different forms (thus functions) in the second parameter 'conditional statement'. Bearing this in mind, the function is called each iteration, thus slowing your procedure down. Therefore, on larger looping structures, consider determining the size of the stop value before the loop or consider using something like below:
Code: [hide]
Code: [show]
for ($i = 0, $size = sizeof($bla); $i < $size; $i++)
{
echo $i;
} In the above code, the size of $size is determined within the function, but still only calculated once.
Summary
To conclude, the for() loop is an iterative function of which we know how many iterations to be executed and carried out by the program code.

Building Blocks of PHP

Understand the linguistic terms of PHP, including boolean, operators, variables and constants.
Variables
A variable is a special container that you can define, which will then contain a value you specify. For example a number, string, object, array or boolean.
Constants
If you want to work with a value that needs to remain unchanged, you can define and use a constant variable. This isdifferent to a variable as variables offer a flexible way of storing data as you can change their values and type of data they hold.
Globals and Superglobals
In addition to global declerations aof your own, PHP has built in predefined variables called superglobals. These are always present and the value they hold can be available in all your scripts.
Predefined Constants
PHP provides some built in constants for you. For example __FILE__ returns the name of the file that PHP is using. __LINE__ returns the line number that php is running and PHP_VERSION returns what php version your script is being run on.
Data types
Different types of data will take up different amounts of memory and may then be treated different in the script that you write. PHP will automatically determine the data type for the variable the time data is assigned to it. Some examples of data types are boolean, integer, float, string, object, array, resource, null (an uninitialized value).
The Assignment operator
The equals sign (=) is an assignment operator and will put the value on the right hand site and assign it to the left hand side.
Arithmetic Operators
Arithmetic operators perform mathematic operations on the values you want them to (providing they are a number). Some examples are addition (+), subtraction (-), division (/), multiplication (*), modulus (%). You can increment numbers by putting two addition operators nxet to eachother like so: (++). PHP provides combined operators which allow you to transform the left hand operand and return a result, while also modifying the original value of the variable. To return 'x' and and 5 to 'x' on the same line you would use '$x +=5.'
The Concatanation Operator
The concatanation operator allows you to join strings together. It is represented by a single period (.). Expressions, calculations and variables can also be concataned and the data type returned will aloways be that of a string.
The Comparison Operator
Comparison operators perform comparative tests using their operands and return the boolean value true if the test is succesful and false if it false. Some examples are Equivalence (==), Non-equivalence (!=), greater than (>), less than or equal to (<=). You can use logical operators such as Or (), and (&&) and Not (!) to extend comparisons using the if() statement.

Tuesday, June 16, 2009

Keyboard Shortcut Keys in photoshop

The following are some of the short cut keys that are available in Photoshop 5. Presumably most (if not all) of them should also be available in other versions of Photoshop. (Except where indicated, Mac users should substitute the Command key wherever the CTRL key is mentioned below.)
CTRL+A
Select All (Select menu)
CTRL+B
Adjust Colour Balance (Image menu)
CTRL+C
Copy (Edit menu)
Shift+CTRL+C
Copy Merged (Edit Menu)
CTRL+D
Deselect (Select menu)
Shift+CTRL+D
Reselect (Select menu)
CTRL+E
Merge Down (Layer menu)
Shift+CTRL+E
Merge Visible (Layer menu)
CTRL+F
Last Filter (Filter menu)
Shift+CTRL+F
fade (Filter menu)
CTRL+G
Group with Previous (Layer menu)
Shift+CTRL+G
Ungroup (Layer menu)
CTRL+H
Hide Edges (View menu)
Shift+CTRL+H
Hide Path (View menu)
CTRL+I
Adjust Invert (Image menu)
Shift+CTRL+I
Invert Selection (Select menu)
CTRL+J
New Layer via Copy (Layer menu)
Shift+CTRL+J
New Layer via Cut (Layer menu)
CTRL+K
General Preferences (File menu)
CTRL+L
Adjust Levels (Image menu)
Shift+CTRL+L
Adjust Auto Levels (Image menu)
CTRL+M
Adjust Curves (Image menu)
CTRL+N
New (File menu)
Shift+CTRL+N
New Layer (Layer menu)
CTRL+O
Open (File menu)
Alt+CTRL+O
Open As (File menu)
CTRL+P
Print (File menu)
Shift+CTRL+P
Page Setup (File menu)
CTRL+R
Show Rulers (View menu)
CTRL+S
Save (File menu)
Shift+CTRL+S
Save As (File menu)
Option+Command+S
Save a Copy (File menu - Mac only).
CTRL+T
Free Transform (Edit menu)
Shift+CTRL+T
Transform Again (Edit menu)
CTRL+U
Adjust Hue/Saturation (Image menu)
Shift+CTRL+U
Adjust Deaturate (Image menu)
CTRL+V
Paste (Edit menu)
Shift+CTRL+V
Paste Into (Edit menu)
CTRL+W
Close (File menu)
CTRL+X
Cut (Edit menu)
CTRL+Y
Preview - CYMK (View menu)
Shift+CTRL+Y
Gamut Warning (View menu)
CTRL+Z
Undo (Edit menu)
CTRL+0
Fit on Screen (View menu)
Shift+CTRL+0
Actual Pixels (View menu - windows only)
Alt+Cmd+0
Actual Pixels (View menu - mac only)
CTRL+]
Arrange - Bring Forward (Layer menu)
Shift+CTRL+]
Arrange - Bring to Front (Layer menu)
CTRL+[
Arrange - Send Backward (Layer menu)
Shift+CTRL+[
Arrange - Send to Back (Layer menu)
CTRL++
Zoom In (View menu)
CTRL+-
Zoom Out (View menu)
CTRL+;
Hide Guides (View menu)
Shift+CTRL+;
Snap to Guides (View menu)
Alt+CTRL+;
Lock Guides (View menu)
CTRL+"
Show Grid (View menu)
Shift+CTRL+"
Snap to Grid (View menu)

How to save a tool with the Tool Preset Palette.

Before I started working on this, I'd never used the Tool Preset Palette. It was just one of those five thousand pull down menus I was always opening by mistake.
As with many things in Photoshop, there are multiple ways to get to the Tool Preset Palette. Here are two:
(1) A pull down menu "Tool Preset Picker" (TPP)on the left of the Options Bar.
(2) A tab on the History Palette.



It works like this.


Choose the tool and settings you wish to save. In this case I have the Pencil tool, set to 4 pixels, and black.
Click on the little Arrow button in the upper right corner of the TPP or the History Palette, and select “New Tool Preset.”



A window will pop up with a field for naming the preset. If the tool is a brush or pencil, an option is provided for saving the color with the preset. You can accept the name PhotoShop offers, or make up your own. You could use your friend's names, but It's easier to keep track of them if the name is relevant (and some of us don't have that many friends).
When you have finished defining your preset tools, use the TPP menu to Save Tool Presets. I recommend saving your new set under a unique name to distinguish it from your default tool presets. (I named mine after my favorite peripheral, “X-keys”).
So now you too can have a 40 pixel, Color Burn Mode, 42% Opacity, Magenta brush named Maggie in your TPP, but you still have to mouse away from the drawing to open the menu and get the tool, right? Not if you keep going.