Practical Work Practical Work Practical Work Practical Work Material Material Material Material
Practical Work Practical Work Practical Work Practical Work Material Material Material Material
04
—John F. Kennedy
1
KS091302 – Introduction To Information System Practical Work Material
Prepared By
Diah Rahmah N, Maulana Puji et. al.
2
KS091302 – Introduction To Information System Practical Work Material
Table of Contents
3
KS091302 – Introduction To Information System Practical Work Material
4
KS091302 – Introduction To Information System Practical Work Material
For instance, bellows are step by step instructions how to create a new
database at your DBMS MYSQL:
1. Firstly, make sure your apache, mysql, and PHP has been
started, if you use xammp server, just activate it. Then open at
5
KS091302 – Introduction To Information System Practical Work Material
6
KS091302 – Introduction To Information System Practical Work Material
Bellows are step by step how to create table psi with its five fields:
1. Type table name in the fieldname (in this case is : psi) and
number of field (in this case is : 5), then click GO button as
shown by Figure 3.
7
KS091302 – Introduction To Information System Practical Work Material
2. Next step is entering each field name and its respective type (
in this case all fields are varchar) as shown by Figure 4. Finally,
just click SAVE button to make sure the table will be created in
seconds.
8
KS091302 – Introduction To Information System Practical Work Material
Actually, to create GUI you must understand and familiar with HTML
(hypertext markup language). All web documents are written in HTML
format. To make sure that each web document is written in HTML,
open any URL at your Mozila browser then click menu View and Page
Source or just use shortcut Ctrl + U. You will see the HTML code of the
respective web page. To learn about HML you can refer to [1].
Absolutely, it will be tedious work if you create GUI using HTML code
from stracth. Fortunately, rightnow there are many HTML editors that
easily help you to create GUI. The most common used HTML or Web
editor is Editplus [2], Macromadia Dreamweaver [3], and Microsoft
Frontpage [4].
Suppose we will create a GUI for capturing our web visitor comments,
bellows are step by step instructions how to make it (Make sure you
have installed Macromadia Dreamweaver at your computer, and open
it):
9
KS091302 – Introduction To Information System Practical Work Material
10
KS091302 – Introduction To Information System Practical Work Material
11
KS091302 – Introduction To Information System Practical Work Material
12
KS091302 – Introduction To Information System Practical Work Material
8. Insert the radiobutton name and value. For example, set the
name of both radiobutton to “jenis” and set the value of first
and second radio button to “laki-laki” and “perempuan”
respectively. To do so, see properties view in bottom side of
MD and type the respective radiobutton name and value. (see
Figure 12)
13
KS091302 – Introduction To Information System Practical Work Material
10. Insert list/menu name and value. For example, set list/menu
name to “status” and set the values to “pelajar, mahasiswa,
bekerja” in properties window view at the bottom side of
MD.(see Figure 14).
14
KS091302 – Introduction To Information System Practical Work Material
15
KS091302 – Introduction To Information System Practical Work Material
13. Create two buttons i.e. SAVE button and RESET button by
choosing Insert tab -> Form -> Button. (see Figure 17)
14. Set button name, value, and action with: “simpan”, “simpan”,
SUBMIT and “batal”, “batal”, RESET for first and second button
respectively in properties window at the bottom of workspace
(see Figure 18)
16
KS091302 – Introduction To Information System Practical Work Material
15. Save your php file into folder in htdocs directory. For example
we save “psi.php” into modul4 folder in htdocs (see figure 19).
17
KS091302 – Introduction To Information System Practical Work Material
After creating the database followed by creating the GUI, now how
to connect the GUI with the database and its vise versa? Suppose
visitor enter comment via the given GUI, then how to save this
comment into database and display back at your website?
18
KS091302 – Introduction To Information System Practical Work Material
You must change X with the host name of your database, usually is
localhost, Y is the username of database (remember when you
firstly install it) the default is root, Z is the password of respective
username of database, and V is message that will be displayed
when it is failed to connect with database. D is the database name.
3. Make sure you have been familiar with this code, if you
confuse with this code you can refer to [6]. Concisely this PHP
code can be explained as bellows:
a. Line 9, it calls file named connect.php, the file that we
just created in advance to connect with database
MYSQL.
b. Line 12-22 is setting variable with respective field
name in the GUI or form.
19
KS091302 – Introduction To Information System Practical Work Material
Now, what about if the case is its vise versa. How to display
the data from the database to your web page or to your GUI?
20
KS091302 – Introduction To Information System Practical Work Material
3. View the code, and modify the second rowi.e. second <tr>
</tr>. Each row in table is encoded by <tr> -- </tr>. In each
row can consist many fields or columns that encoded by <td> -
- </td>. Make sure your code is as shown by Figure 24.
Concisely, this code can be explained as bellows:
a. Line number 23 is including file connect.php to
connect this page with data from database.
b. Line number 24 is retrieving all data from table psi in
the database. It is SQL code, and * means retrieve all
columns in the table, if you want to retrieve some
column only, specify the column name such as: select
nrp, name from psi.
c. Line number 26 until 37 is retrieving data from table
psi one row by one row. Each row in table psi in
database is displayed in each row in this web page.
d. Variable $no here is incremental variable that will be
added 1 in each single looping.
e. In Line 26, All data retrieved from table psi is stored
in variable $baris. $baris is an array variable with
index 0, 1, 3 and so far that representing column
number 1, 2, 3 and so far respectively.
21
KS091302 – Introduction To Information System Practical Work Material
22
KS091302 – Introduction To Information System Practical Work Material
To make sure that your GUI now is connected with your data
in database MYSQL, follow bellows scenarios:
2. Just key in your data into respectictive form field. Then click
SAVE button. Make sure your code is free from error, if so,
make sure the data that you key in in the from is inserted in
the respective table in seconds. You can check it by opening
the respective table using phpmyadmin.(See Figure 27)
23
KS091302 – Introduction To Information System Practical Work Material
Sometime, you want to make restriction such as: all fields can
not be empty, all NRP field must be started by 52 and so forth.
You can do so by using what it is called client-side web
programming language i.e. Java Script (Not JAVA), or
Asynchronous JavaScript and XML (AJAX) (Remember: PHP is
server-side web programming language). If you interest learn
javascript you can refer to [8]. If you want to make your
website more attractive and multi processing in the same page
such as in Facebook you can learn AJAX technology. Resource
from [9] and [10] is a good recommendation for you.
Another way to make sure that your data has been inserted in
database is by open view_psi.php file at your browser that will
be executed automatically after clicking SAVE button as shown
by Figure 28.
24
KS091302 – Introduction To Information System Practical Work Material
Self Assesment
25
KS091302 – Introduction To Information System Practical Work Material
[1] http://www.master.web.id/mwmag/issue/08/content/tutorial-
dreamweaver-1/tutorial-dreamweaver-1.html
[2] http://www.ilmugrafis.com/dreamweaver.php
[3] http://www.klik-kanan.com/desainweb/dream/index.shtml
[4]http://www.entheosweb.com/website_design/css_styles_tutorial.as
p
[5] http://achmatim.net/2008/12/22/dreamweaver-php-dan-mysql-
untuk-aplikasi-data-mahasiswa/
[6] http://prothelon.com/mambo/home/
[7] fach-az.co.cc/images/stories/Artikel/TUTORIAL_WEBDESIGN_2.pdf
26
KS091302 – Introduction To Information System Practical Work Material
BIBLIOGRAPHY
[1] http://w3schools.com/html/default.asp
[2] http://www.editplus.com/
[3] http://www.adobe.com/products/dreamweaver/
[4] http://office.microsoft.com/en-us/frontpage/default.aspx
[5]http://www.dl4all.com/software/5038-portable-adobe-
dreamweaver-cs3-9.0.html
[6] http://w3schools.com/php/default.asp
[7] http://w3schools.com/sql/default.asp
[8] http://w3schools.com/js/default.asp
[9]http://speechyourm1nd.blogspot.com/2009/09/panduan-belajar-
ajax-bagi-pemula.html
[10] http://w3schools.com/ajax/default.asp
[11]http://www.tutorialized.com/tutorials/Dreamweaver/CSS/1
[12] http://www.w3schools.com/css/
[13] http://www.csstutorial.net/
[14] [7] fach-
az.co.cc/images/stories/Artikel/TUTORIAL_WEBDESIGN_2.pdf
27