Saturday, March 31, 2012

PHP - creating database and connection

29/3
site name: projek2 - letak di c:/xampp/htdocs/
database: info - letak di c:/xampp/mysql/data/

1.       Stop IIS
2.       Start xamp
3.       Check //localhost
4.       Change password for root
a.       Default root pasword – none
b.      Set password according to the previous activity



5.       Restart localhost
6.       Set database
phpmyadmin
7.       Point to your database


8.       Rule of thumb for field  (+1)  (for primary key)
a.       Autoincrement id (automatic)
b.      Unique key (not automatic)

Varchar – need to set the length
Null – depends whether can be blank or not
9.       Browse table for structure

1.       Create database

 
c. create site
1.       Name the site

 
  
D. Create a connection

Friday, March 23, 2012

PHP in action

Since we are goint to use PHP in Microsoft Windows environment...

1) First thing to do is... stop IIS server if it exists

  1. Click Start, and then click Control Panel.
  2. Do one of the following:
    • If you are using Windows Vista® or Windows Server® 2008, click System and Maintenance, and then click Administrative Tools.
    • If you are using Windows® 7 or Windows Server® 2008 R2, click System and Security, and then click Administrative Tools.
  3. In the Administrative Tools window, double-click Internet Information Services (IIS) Manager.
  1. Click Start.
  2. In the Start Search box, type inetmgr and press ENTER.
2) Install XAMPP or WAMPP. Make sure when we browse to http://localhost/, it will point to XAMP instead of to IIS

3) For security, create password for 'root'

4) Login into phpAdmin and start creating the database and the needed fields

5) In Dreamweaver, create a site for the project

6) Create a connection to link the site with the Database in MySQL

7) Start creating the PHP files
  
   - login.php          (first page of this website)
   - register.php      (no username, then has to register first)
   - input.php          (redirected page after login to type in comments)
   - view.php           (display the comments that were input)

 

Automated Server Behaviour


* login.php - User Authentication --> Log In User
( Username and passwords will be checked whether they match or not...)

* register.php - User Authentication --> Check New User
( Username will be checked whether duplicate username exists...)

* input.php - Insert Records
(Input will be inserted into the database according to the matching field names)

* view.php - Recordset, Bindings, Repeat Region


best if i can display my work.. but argghh.. there are so many files that are jumbled up... not sure which one is the right one already...


Security Introduced...

Dr. Zaida introduced concepts of security in website development

1) Through login page.. no login.. no page

2) Pages restriction ( linked with login page)
    Server behaviour : User Authentication --> Restrict Access to Page

3) Acces level
    - set alongside the username and password
    - checked during login

Friday, March 16, 2012

ASP in action

The waited part ends...

The hectic part begins... (especially with Dr. Zaida.. : D )

The beginning of dynamic web page creation... by first using ASP.. that means Microsoft environment

1) First thing to do, if your computer does not have IIS, then IIS needs to be install.. .
    Alhamdulillah, Dr. Zaida provide handouts to us.. bless her..

2) Open up Dreamweaver and start creating 'site' giving all its particular information

3) Since this is a small database, Microsoft Access will do. Create a database and label the fields

4) Create the connection between the database and the site

5) Start doing the Contact Form using Dreamweaver

   Tools used - Insert Form , Insert Form --> Fields, Insert graphic, Insert Table and so on

6) Choose the server behaviour to save input from the users in the Contact Form into the database
   
     Server Behaviour --> Insert Record

PRACTICE is essentia....!!

Saturday, March 10, 2012

ASP vs PHP

ASP and PHP are two widely used programming tools in website development. Both has its own characteristics and advantages

We start with ASP

- Microsoft based 
- Operating System : Windows
- Web server : IIS
- Database: MS SQL or MS Access
- Programming Language : Visual Basic
- Additional tools : Need to be purchased

Now, the PHP

- Open source based
- Operating System : FREE Linux
- Web server : FREE Apache
- Database : FREE MySQL
- Programming Language : C++
- Additional tools : FREE

Both programming tools can now operate both in Windows environment, LINUX environment and several other environment like UNIX.

Why do more people prefer PHP over ASP?

Two important factors

 

SPEED

 

COST

Static vs Dynamic pages

Static Pages

- older generation
- one way communication( from server to user )
- purpose : give information
- files are in the format .htm or .html


Dynamic Pages

- newer generation
- SERVER driven
- involves DATABASE
- interactive (two way communication)
- needs server side scripting / translation
- files are in the format .asp or .php

File Management in Website Development

Rule No. 1

Only ONE word for filename in lowercase

Rule No. 2

Create different folders for each topic or subtopic

Rule No. 3

In each of the different folders for each topic should contain 2 folders:
a) images - the images that are CURRENTLY being used in the website
b) media - all the images that are used WHILE developing the website

Rule No. 4

Let index be the main page of your website

Example

WEBPROJECT
  |
  |---> [index.html / index.php / index.asp]    THE MAIN PAGE OF THIS WEBSITE
  |  
  |---> [images]
  |
  |---> [media]
  |
  |--->[Chapter 1]
  |              |
  |              |---> index.html
  |              |
  |              |---> [images]
  |              |
  |              |---> [media]
  |
  |--->[Chapter 2]
                 |
                 |---> index.html
                 |
                 |---> [images]
                 |
                 |---> [media]

Friday, March 9, 2012

Hyperlink and PHP / ASP

Another touch on Dreamweaver.

The 4 type soft hyperlink
1) HTML file -> HTML file
2) HTML file -> homepage
3) link to certain section in the HTML file itself
4) link to email

A few basic concept of designing a web database:
1) File mangement.... use 1 folder to keep all the files...
2) Filename .... case sensitive...

Multimedia Programming vs Multimedia Authoring

A topic in itself..

Multimedia Programming
- the older generation
- using real languages like C or Java
- low level assembly and construction and control of Multimeda elements

Multimedia Authoring
- newer generation
- require less programming knowledge
- using authoring sofware such as Dreamweaver, NetObjects Fusion, Microsoft Frontpage
- high level assembly and bringing together of Multimedia elements
- high level graphical interface design
- high level scripting
- very powerful in creating an interactive, animated, eye-catching website

Why should you use AUTHORING over PROGRAMMING?

           SPEED!!!


That is FASTER development time..

Hyperlink in files

4 types of hyperlink are introduced today..

1) hyperlink to a HTML file
2) hyperlink to a document
3) hyperlink to a different location within the same file by using anchor
4) hyperlink to email


Maintaining Existence ...Important!

We are recommended to choose "Target : BLANK"  when opening other people's website. 
Reason:  A new window will be opened.  YOUR website will still exist for viewing.

Anchoring

- use it for long web pages
- best used for printing
- not recommended for viewing

Thursday, March 8, 2012

Web Page, Web Site, Portal

Web Page?

A Single page

Web Site?

A Collection of Web pages, images, videos or other digital assets

Portal?

A collection web sites of a certain topic or interests


Still confused..?

Read up more in

http://en.wikipedia.org/wiki/Web_page
http://en.wikipedia.org/wiki/Web_site
http://en.wikipedia.org/wiki/Web_portal

Saturday, March 3, 2012

First Actual Web Pogramming Class

Finally..

My years of longing to learn Web programming has finally being fulfilled.. alhamdulillah..(even though this class is only on Web Authoring.. he....he...  I'm sure throughout the course a bit of web programming will be taught in the class.. of course, not on the whole specific subject.. Masters students... SELF EXPLORE is the keyword)

Finally, I know the difference between web page, web site and portal
I am however, have been introduced to the concept Web 1.0, Web 2.0, Web 3.0, Web 4.0 and Cloud Computing.  Cloud Computing has its own benefits and disadvantages.  Best in terms that documents are abled to be shared by many people who can edit and save those documents online / directly.  However, these type of actions need high speed and large bandwith for users which Malaysian users are having difficulty with.  Furthermore, one storage of data?  What happens if the data are compromised? Being hacked by users, prone to virus, gone, etc? There goes your documents, your confidential files, your business or even your life!

My conclusion:
Web programs is to ASSIST us in our life.. but not RULE our life...

The second half of the class is our interaction with Adobe Dreamweaver CS3.  Adobe Dreamweaver?  Somehow the name sounds unfamiliar to me after I left Panasonic IT Department. And then... ooohh... Dr. Zaida explained that Adobe got the rights to Dreamweaver after a mistake done by Macromedia. A simple but highly consequential ( does the word exist .. English teacher?) mistake.

P/S Thank you Dr. Zaida for providing us the notes on all of the above.. we love you...