Tuesday 25 March 2014

Reflection on 7th week ( Questionnaire & Forum)

As-Salam dan Hye semua..

Wah.. diam tak diam..this is the last week section untuk Prof Zaida masuk kelas kami. Pada minggu terakhir ini Prof telah flashback kan apa yang dah kami pelajari dalam kelas. Dan pada minggu ini juga kami di ajar cara-cara untuk membuat questionnaire dan forum dalam dinamic website kami. Hmmm.. xsusah rupanya nak create function ni..

Malah Prof juga mengingatkan kami agar menyiapkan group projek kami dan perlu dihantar selepas cuti pertengahan semester nanti. 

Questionnaire 

  • Set up the database first. Login>Create table>Save




  • Open Dreamwever>New>.Php
  • Toolbar layout>div tag.Next, insert form.
  • Type questions.For the answer we will use radio group. Click insert>form>radio group



  • Note : 
    • Name type bangsa
    • Label type the options/answer such as melayu,cina ,india and put the value 1,2,3
    • Click on + button if you want to add another option
    • Layout  using tick table
    • Click ok.

Besides, you also can tick *checked to the answer.This prevent user to leave unchecked for the question.

  • Insert Submit button.
  • Save your file and name it as quiz.html
  • Go to window>server behavior>insert record>after inserting, go to: thank.html

  • Now,we will create thank you page. File>new>html>type your text>save as thank.html
  • Here is the answer that have been key in

  • Put cursor at the table>server behavior>recordset>change name>connection;dmx>table choose quiz>columns tick all>filter: umur, = and entered value ,2 ( this refer on the value you insert at radio group)>ok

Forum
  • Create table at phpmysql.Insert 3 rows: id,name and post

  • Open dreamweaver.file>new>php
  • You will used 3 types of server behavior here: insert record, recordset,repeat region
  • First insert form and type name and message. Put text field beside the name and message.Change the properties of the text field according to the name you insert at the database.name as name and message as post.
  • Then, insert submit button and change the button name to post.
  • Save it as forum.php.
  • Window>server behavior>insert record
  • Outside the form line, type comments from others
  • Go to window>Server behaviour>recordset
  • Go to binding panel and drag name and post under the comments from others. Then, highlight it and go to server behavior>repeat region.


Monday 17 March 2014

Reflection on 6th week ( Dynamic Website using .PHP : More)


As-salam semua..

So ni minggu ke-6 dah kelas Authoring ni. Semakin lama semakin banyak yang saya telah pelajari..So far, saya boleh mengikuti kelas ini dengan baik kerana sekiranya ada ketinggalan atau laptop buat hal, saya masih boleh refer semula apa yang telah diperlajari itu menggunakan Apps yang telah dibangunkan oleh Vicki.
This week, kami telah belajar beberapa function di dalam .php ni. Antaranya adalah:

  • Admin Page
  • View user
  •  Delete user
  • Update user
Cara untuk buat Admin Page:


Step 1 : Create database untuk Admin terlebih dahulu

1. Localhost > PHPmyAdmin > create new table > namakan segabai adminregister > masukkan maklumat id, username, password, dan level. Seperti biasa id di jadikan primary key.

2. Insert > isi pada ruang username dan password (supaya admin dapat login pada LoginAdmin utk access maklumat user) > Go > Done


Admin Page: LoginAdmin.php

1. New > create .php > masukkan element-element seperti di atas.
2. Server behaviors > click pada butang + > user authentication > login user > OK > save as loginadmin.php > Done


Admin Page: ViewAdmin.php
Open Dreamweaver > new > blank page > .php > create > taip dan create table view user, user, add, update user, delete seperti dibawah > save as view_admin.php


View User

  • Buka view_admin.php > recordset > pilih connection dan table
  • Go to bindings > drag fname (firstname) dan lname (lastname) pada column di bawah View User
  • Highlight row kedua > server behaviors > repeat region > all records > OK
  • Server Behaviors >click on + button > go to detail page > pilih detail page > OK

Create viewstudentdetail2.php

  • Open  Dreamweaver > new > blank page > PHP > create > taip table name, email, username, password  seperti diatas > recordset > pilih connection dan table (based on ur database at phpmyadmin)
  • Go to bindings > drag fnam, lname pada row name dan seterusnya
  • Highlight table > server behaviors > repeat region > all records > OK 

Delete User

  • Letak cursor pada row bawah Delete User > ago to insert > form > button > Value tukar kepada Delete 
  • Go to insert > hidden field > Properties : Hidden Field : hd_del ,
    •  Value: klik id > OK



  • Server behaviors > click on + button > Delete record > OK




Update User

  • Highlight Update > server behaviors > click on + button > go to detail page > pilih detail page > OK


  • create update_user.php




  1. Open  Dreamweaver > new > blank page > PHP > create > taip table User ID, First Name, Last Name, Email, Username, Password  seperti diatas > recordset > pilih connection dan table (based on ur database at phpmyadmin)
  2. Go to bindings > drag fnam, lname dan seterusnya pada column yang berkenaan
  3. Server behaviors > click on + button > update record > update table (based on ur database at phpmyadmin) > after updating, go to viewadmin.php > OK



Contoh Output :






Monday 10 March 2014

Reflection on 5th week (Introduction to Dynamic Website using .PHP)


Hye..halloooo guys..

Ohoooo.. Dah byk kan ilmu baru yg kita dapat? Hehe.. Minggu ni kita beljar apa plak ek... Haaa.. Best tau minggu ni.. Sbb kita kan belajar .php plak.. Hehe..senang je yg ni..kalau nk compare dngan .asp tu... Apa tak nya kan, install je XAMPP kat laptop..done!! Easy rite???

TAPI ALWAYS REMEMBER .. .asp dan .php xboleh buat serentak. Sebelum install XAMPP, IIS kena stop dulu.. how? ni step yg paling easy yg saya guna setiap kali nk switch dari IIS ke XAMPP tu..

Control Panel > System and Security > Administrative Tools > Internet Information Services (IIS) Manager>


Cara nak install XAMPP?
Follow this step, confirm berjaya...

Installing XAMPP.


  1. Download from the internet.easy and free: http://www.apachefriends.org/download.html
  2. Then install XAMPP kat laptop atau komputer anda.
  3. Buka XAMPP tadi dan start Apache dan MySQL sahaja. Jangan gatal tangan nak klik yang lain pulak ye.
Untuk pastikan yang IIS sudah betul closed.. Try this . Click  localhost pada browser, akan dapat lihat paparan seperti di bawah:


Creating database using MySQL

  • Database name(rename as info) > create > table > save.
Create connection to database

    • Open Dreamweaver > Open MySQL connection to do connection to the database in Dreamweaver
    Create php file


      • Name as register.php.Use form to let the user to key in their details.
      Use insert record.




      • Data that have been entered by user will be saved into database.
      Create another php file
      • Name it as view.php.View.php will display data that has been entered.
      Use recordset. 
      • Data will be read back/view from the database and display at view.php
      Use repeat region
      • To view all that that has been entered by user

      Dah boleh start wat website guna .php plak.. Database .php ni adalah myPhpAdmin.. Senang, user friendly, interface pun menarik jgak. Arini kami akan buat guestbook..tutorial dan note tak dapat lagi..so Prof ajar je kat depan.. Sy dapat selesaikan semua yg Prof ajar..hehe..leganya rasa..perjalnan kelas sy utk authoring ni berjlan lancar.. Rasa happy je bila masuk kelas.

      Sy xsuka sgt guna komputer makmal actually..so sy bawak lptop sendiri setiap kali kelas.. Bila guna laptop sndiri, bila ada errror pada seting senang nk detect.. Kalau yg makmal.. Guna windows xp..huhu.. Xreti la dgn windows ni. Sy prefer yg Windows Vista dan Windows 7 je ..:). Bukan nk berlagak.. Tp sbb da biasa guna yg ni, so buat apa susahkan diri utk explore windows lama ..kan?



      Monday 3 March 2014

      Reflection on 4th week (Introduction to Dynamic Website using .ASP)

      Salam & Good day...

      Cepatnya masa berlalu.. Dah minggu ke-4 sesi kuliah di smester 2 sesi 2013/2014 nie.. Hmm.. Apa ek ilmu yg sy pelajari pada kelas authoring minggu ni? Untuk pengetahuan anda, sy belajar cara-cara utk install IIS untuk windows 7.. Leceh jgak nk setup benda alah ni..tp dengan adanya bantuan note yg diberikan oleh Prof Zaida dan Dr Sykin pada minggu lepas.. Dan apps yg diberi..akhirnya sy berjaya install IIS dalam laptop sy sebelum kelas bermula..

      Bukan ape, kalau x setel setup IIS ni.. Big problem la jawab nya.. Mana tak nya, kelas minggu ke 4 ni..kami akan belajar cara2 membina dinamik web site dengan menggunakan .asp dan microsoft access. Dah lama guna perisian Microsoft.. Tp yg familiar just microsoft word, microsoft excel, microsoft powerpoint dan microsft publisher je selama ni.. Bila Prof Zaida ckap pasal microsft access..terus Google la mcm mana nk install.. Tp, huhu..rupa-rupanya.. Tak payah install.. Dah ada dah dalam laptop sy ni.. Hehe.. Apa lagi..let's explore!! Xsusah pun nk guna access ni.. Sy dah biasa guna myPhpAdmin utk .php.. So, secara asasnya..function nya lebih kurang la.. Hoho.. So skrg dah tahu la jgak sikit2 pasal .asp ni. Kata org kalau xreti, jgan mlas2. Rajin2 la google, tgok youtube dan explore apps dalam ipad Prof Zaida bg tu.

      Pernah tgok tak picture kat bawah ni? Ni lah interface yang keluar pada paparan laptop kita bila kita taip kat browser  - http://localhost/

      Paparan untuk Microsoft Access



      Untuk permulaan : Click Blank Database > File Name tukar kepada Microsoft Access Database (2002-2003 format) (*.mdb) > Click Ok > Click Create.


      Seterusnya, ini adalah paparan bagi Micr Access ni tau.. simple, user friendly dan senang je nak guna. Dengan sekali explore saya dah boleh create database using this software.


      Contoh database yang dah di bina di
      dalam Ms Access :


      Then, untuk create dynamic website using .ASP ni, pertama sekali mesti ikut rule wajib ni :

      1. Create a Database using Ms Access.
      2. Create a connection to the database in Dreamweaver.
      3. Create .ASP file-consist of form and textfield.
      4. Use Insert Record to save the data from the database.
      5. Create an ASP file to view back the data from the database.
      6. Use RecordSet to view the data from the database.
      7. Use Repeat Region to view all data.
      Coding untuk ASP connection (Ms Access):

      "Driver={Microsoft Access Driver (*.mdb)};DBQ='&Server.MapPath("/data/db1.mdb")

      Before masuk kelas..sy dah siapkan task yg diberi utk buat laman web  .asp ni. So, bila Prof Zaida explain kat depan..sy lebih cepat faham dan dan dapat laksanakan step2 yg beliau ajar.. Prof Zaida byk kali pesan "sy ni ckap laju, jalan laju, dan otak pun pk laju".. Bertuahnya kan, dikurniakan dengan kelebihan macam ni..
      Jd, kalau malas nk explore dulu sebelum kelas.. Mmg xpat catch up la dengan lecture beliau.. Sae yg rugi? Kita la.. So better explore dulu k..Kalau tak, mmg akan cepat lost.. :(