Wednesday, April 15, 2009

Ch. 8 Control Your Data, Control Your World

This chapter discussed about databases and how they relate to one another. 

Things Learned:
schemas - representation of the structures within a database
normalization - altering the design of a database to reduce duplicate data and improve placement of new data
Foreign Key - a column in a table used to relate a table to another table
for() - a loop code
? : - ternary operator used to perform simple true/false expression like a if-else statement
Inner Join - let you join table from two tables with matching rows
AS name - use as aliases to make column/table names more simple to code 

Ch. 7 cont.

Things learned:
PHP can used require_once to includes other code so that you don't have to type things over and over again.  As in, you can just include a header or footer instead of re-typing it. 
Sessions are don't last as long as cookies. 

Tuesday, March 31, 2009

Ch. 7 - Building Personalized Web Apps

This chapter talks about making a web application remember who you are by using sessions and cookies. 

Things learned:
setcookie() - this PHP code is used to set a cookie on the browser, you can provided a expiration date also in this code
$_cookie - array to store cookies
SHA (value) - encryption code to make data unrecognizable within database
session_start() - PHP code to start a new session
session_destroy () - this closes a session
$_session - array with each session data

Ch.6 Cont.

Things Learned:

We remove the HTTP script and made it's own separate file so we can include it in more than one script
This adds more security to the site and prevents people to directly accessing the page through used of a bookmark
Human moderation improves integrity on a site.
double-hyphen(--) or number sign(#) - is used to comment things out in SQL 
SQL injection - form data is used to change the operation of an SQL query
trim() - get ride of leading and trailing spaces in form data
mysqli_real_escape_string() = converts dangerous characters into an escaped format
You can default values in sql tables.
is_numeric() - making sure the value enter is numeric


Monday, March 30, 2009

Ch. 6 - Securing Your Application

This chapter discuss the importance of security and making sure you have a secure site where people can access data without permission. 

Things Learned:
HTTP provides a simple way to secure a page using PHP. When someone tries to access the admin page,  a pop window will display requesting a user name and password from the user. HTTP authentication involves establishing a line of communication between the browser and the server through HTTP. 
The dialog between the browser and server takes place through headers, little text messages with instructions. All web pages are displayed with the help of headers. 

Header function - header();
*should precede any HTML code in PHP script

Depending on what the user's types in, the headers can take three different actions: accept, retry or deny access

Different type of headers: location, refresh and content type header

"basic realm" - security zone 




Sunday, March 29, 2009

Finalized Project

I will add an event registration feature to my website: ugalambdas

The event registration will let you register for an event and if it cost money, it will let you either pay online or send in a check.

Basically, there will be a web form where the user can enter in all the necessary information. There will be validation code to check to make sure all the necessary information is entered in correctly. When the form is submitted, it will either direct the form to a online pay site or send it to a page with the address to send the check.

This project will use PHP to direct the user to the correct page after the form has been submitted.

Wednesday, March 18, 2009

Ch. 5 Cont.

Things learned:

include, include_once, require, require_once - script code that allow users to share code across multiple scripts. 
ORDER BY - an SQL command used to order things in a database
LIMIT - SQL command that limit the amount a statement can delete, this ensure accuracy of the deletion
UNLINK() - this deletes a file from the web server

Get method - used for data retrieval that doesn't change anything on the server. This method is shown in the url bar. Usually for directly sending data to server in a URL. 
Post method - used to send data to the server that somehow changes the state of the server. This method is hidden in the url bar. Usually used in web forms.