Friday 14 March 2014

Refleksi Minggu Ke-5

Alhamdulillah...for the 5th week in authoring lecture, we were introduced to develop a dynamic page using PHP. In the last week's post, we knew how to make an ASP page by creating a database using Microsoft Access and the testing server using IIS. However, for PHP we are using MySQL as a database and Apache as a testing server.

Before developing a PHP page, we have to install full package of testing server of PHP (Apache) and database platform (MySQL) called Apache.

Steps to install XAMPP.
  1. Download XAMPP from any web such as http://www.apachefriends.org/index.html (XAMPP provide Apache + MySQL + Perl and so on).
  2. Make sure to stop IIS server so Apache will be running smoothly.
  3. Follow the instruction to install.
  4. Folder "C:\:xampp" will be created automatically.
  5. Click start if the Apache and MySQL are still not starting
  6. Open any Web Browser and type http://localhost (your Apache will be appeared)
  7. Choose english language (according to your priority)
  8. Setup the security of Apache. Click "Security > http://localhost/security/xamppsecurity.php "
  9. Create your own password with MySQL SuperUser : root (eg. MySQL username : root, password : 1234)
  10. You are ready to use MySQL


Steps to develop a PHP page (similar to develop an ASP page):

  1. Create a database first - MySQL
  2. Create a site before develop a webpage in Dreamweaver
  3. Create a connection to the database in Dreamweaver
  4. Create a PHP file - consists of form and textfield
    • Use Insert Record to save the data into the database
  5. Create a PHP file to view back data from the database
    • Use RecordSet to view the data from the database
    • Use Repeat Region to view all data.
  6. Create a PHP file to make a user authentication 
    • Use User Authentication > Restricted Page ()
    • Use User Authentication > Login User

Create a database first using MySQL


  1. Create database and table : eg. dataphp
  2. Folder dataphp will be added to C:/xampp/mysql/data/dataphp automatically


Create a site before develop a webpage in Dreamweaver

  1. Choose Site>New Site
  2. Create a folder (eg. projek) - the folder must be in C:/xampp/htdocs/projek
  3. Add server with web URL = http://localhost/projek/
  4. Make sure to choose Testing Server > PHP MySQL

Create a connection to the database in Dreamweaver


  1. Open Adobe Dreamweaver CS6
  2. Choose a PHP blank page
  3. Choose Database > + > MySQL Connection
  4. Fill the blank like shown


Create a PHP file - consists of form and textfield
  • Use Insert Record to save the data into the database
  1. Open a new blank PHP file
  2. Save as contact.php
  3. Insert form, textfield with 5 elements (firstname, username, email, website and message) and a submit button.
  4. Choose Server Behaviour > Insert Record and fill in the blank
  5. Use User Authentication > Restrict Access to Page (will be explained in creating login page part)

Create a PHP file to view back data from the database
  • Use RecordSet to view the data from the database
  • Use Repeat Region to view all data.

  1. Open a new blank PHP file
  2. Save as view.php
  3. Create a table fill with firstname, username, email, website and message and create a line (to separate the informations viewed from different users)
  4. Choose Bindings > Recordset (Query)
  5. Select the table and the line made.
  6. Choose Server Behaviour > Repeat Region

Create a PHP file to make a registration page
  • Create a new table in folder C:/xampp/mysql/data/dataphp using MySQL
  • Use Insert Record to save the data into the database
  1. Create a new table with MySQL
  2. Open a new blank PHP file
  3. Save as registration.php
  4. Insert form, textfield with 4 elements (name, username, password, email) and a submit button.

Create a PHP file to make a login page
  • Use User Authentication > Login Page
  1. Open a new blank PHP file
  2. Save as login.php
  3. Insert form, textfield with 2 elements (username and password) and a submit button.
  4. If the user inserts wrong username and password - the page will be back to the registration page.


I hope you can develop a dynamic page as well using PHP!!

No comments:

Post a Comment