Monday, March 17, 2014

WEEK 5

Assalamualaikum wbt and Hi everyone...

In week 5, we learn on how to develop dynamic web page using PhP. So, as what I did before, here I’ll share the steps and techniques on how to do that.

Install Xampp and stop IIS


First thing to know, in developing web page using PhP, we must have Xampp as a server. We can just download from the internet and install it. After finish install, click at C> Xampp > start button at Module Apache and MySql. But before that we have to click stop button at IIS first.



Figure 1


Figure 2

Run and text localhost

1. Type localhost at URL bar > click security > scroll down until we find http://localhost > click at the URL > setting new password> start log in

Figure 3

Create Table


  • Click phpMyAdmin > New Table > type database name “register” > create
  • Click register table > type table name "tableone" > set up number of column “5” > go.
  • In designing table, I have choose 5 column consist of id, name, username, password and remarks.
  • For id, I set up it as primary and auto increment. And for the rest I just set up as text.
  • The result of tableone are as Figure 4.


Figure 4

Create New Site


  • Open Dreamweaver > click Site > New site >
  • Type the name of your site as “myprpjectone” > Next
  • Click “Yes, I want to use a server technology” > Next
  • Choose PHP MySQL as server technology > Next
  • Click “Edit & test locally (my setting server is on this computer)
  • Choose folder where you want to store your files or just type C:\xampp\htdocs\myprojectone\
  • Test the URL. If success, that means the site has been created. See Figure 5.


Figure 5

Create New Page
  • Now is the time for me to create new Page. This page is for user to register before log in to the website.
  • File > New > Blank Page >
  • Choose Page type as PHP > Create
  • Design table and form consist of 4 elements which are Name, Username, Password and Remarks.
  • When designing table, we have to personalize a few things in at text field.
  • For Password, we have to click password at text field properties.
  • For Remarks, we have to choose multiple line at text field properties.
  • Dont forget to put register button at the bottom of the table.
  • Save and name this page as daftar.php
  • The result as at Figure 6



Figure 6

 Create view Page
Repeat the step above for another new page. Save and name the page as “papar.php”
See Figure 7


Figure 7

Make Connection
  • Open daftar.php
  • Click Database (on Application tool )> My SQL>
  • Fill up the box at MySQL connection:-
  • i)My SQL server : samb
  • ii)User Name : root
  • iii)Password : 1234
  • iv)Database : register ( we have to choose the database name that we have save in phpMyAdmin before )
  • The result as at Figure 8.



Figure 8

5.     Click Test. The ‘success’ box will pop up means that the connection have been done successfully.

How to use Server Behavior
  • Open papar.php
  • Click server behaviour > recordset
  • Choose “samb” at connection and “tableone” at table space.
  • Sort id as ascending and then click ok



Figure 9


  • Open daftar.php
  • Choose server behaviour > insert record
  • Choose “ samb” at connection and “ register “ at insert table
  • After inserting go to papar.php page



Figure 10
  • Open daftar.php
  • Highlight the table
  • Click server behaviour> repeat region.
  • This is for us to view all information that has been key-  in by the user.


I hope that this step can help us in developing dynamic website. I'll share much more techniques and steps in the future. 

Wassalam



























No comments:

Post a Comment