Monday, 28 March 2016

WEEK6_Introduction PHP

Today we learned about PHP. Throughout this class, i feel PHP is interesting and fun. This is because when you miss something, it cannot be run in system.

What is PHP?
PHP is an open source and eventually the name changed to PHP Hypertext Pre-procesor.

Advantage of PHP:
a. easy to use
b. open source
c. multiple platform
d. language support for database


  • must saved with a php extension
  • must be terminated with a semicolon ;
  • not generally case-sensitive
  • character to indicate Comments : - // or # : single line
  •                                                       - /* here is an introduction to server side script code inside a                                                                    multi-line comment */ : multi-line comment
PHP Syntax
1. PHP comment
2. Output / Display statement


Variables and Data Type
- variable contain a piece of data
- all variable in PHP begin with a $
- variable names are case sensitive

Operator 



Conditional Statement and Loops


Arrays
- array is a variable only contain a multiple value under a single variable name
- Example: To store information about a car in an array, we could use the following line; 

$CarInfo = array ("Avanza", "2004", 34500);
// an array could contain different type of variables

OR

$CarInfo = array();
$CarInfo [0] = "Innova";
$CarInfo [1] = "2002";
$CarInfo [2] = 34500;


Thursday, 24 March 2016

WEEK5_Installation XAMPP

In this lab session, we are asked to bring laptop to install XAMPP in our laptop.

download free : https://www.apachefriends.org/index.html

XAMPP is a free and open source cross-platform web server package, consisting mainly of the
1. Apache
2. MySQL
3. PHP
4. Perl programming language

We should store our file that need to connect to Xampp in htdocs file

Example: the folder named "lab_HTML_BASIC" is save in htdocs folder, open the XAMPP to start, then u can start to launch the website http://localhost/lab_HTML_BASIC/main.html.



Interface of XAMPP

Monday, 21 March 2016

WEEK5_CSS & JavaScript

3 way of inserting a style sheet:

1. External style sheet


2. Internal style sheet


3. Inline style



CSS Selectors =to apply a declared style

selectors type have:

a. Element selectors
b. Class Selectors

.legs { font-weight: bold; background: pink;}

c. ID Selectors

#snout { border: solid red;}

d. Pseudo Selectors

-specific to hyperlink



JAVA Script

where to put JavaScript?
* between the HTML document's head tags
* within the HTML document's body
*in an external file 








Thursday, 17 March 2016

WEEK4_QUIZ WWW

Today our class held quiz for slide 1-4, there  are 30 question in quiz.

1. What is the correct HTML for adding a background color?

a. <bgcolor="yellow"> Incorrect

b. <body bgcolor="yellow">

c. <background>yellow</background> 


2. What is the correct HTML for making a checkbox?
a. <checkbox>

b. <input type="checkbox"> Correct

c. <check>

d. <input type="check"> 


3.High-level language needs compiler to translate to machine languages
 a. True

b. False 


4.Choose the correct HTML element for the largest heading:
a. <h6>

b. <heading>

c. <h1>


5.  What is the correct HTML for inserting a background image?
a. <background img="background.gif">

b. <body background="background.gif">

c. <body bg="background.gif">


6.  Choose the correct HTML element to define emphasized text
a. <strong>

b. <italic>

c. <em> 


7.Which tag contains ALL of the website's visible content?
a. <title>

b. <body> 

c. <html>

d. <head> 


8.HTML comments start with <!-- and end with -->
a. True 

b. False 


9.Example of High Level Language
a. COBOL

b. C++

c. FORTRAN

d. BASIC


10.What is an HTML element?
 a. Everything which is visible when viewing the site

b. Everything inside the head tag

c. Start tag and an end tag, with content in between

d. Content inside body tag 


11. How can you open a link in a new tab/browser window?
a. <a href="url" target="new">

b. <a href="url" new>

c. <a href="url" target="_blank"> 

Tuesday, 15 March 2016

WEEK4_Class of Client Server & Internet Application

In today class, we are learn about the concept of Client server (Client Side Script Server Side Script) & Internet Application.

Client and Server - cooperate to deliver network services

Client is to initiates communication and server is to send information's back to client.


Client-Side and Server-Side


Client-Side Scripts
Server-Side Scripts
Are interpreted by the browser
Proceed by the server to generate HTML
Can embedded into HTML documents or contained in separate file
Provide interactive web sites that interface to database or data stores
Proceed at browser

Reduce the number of requests



Internet Application 

Network Application Support
Transport Protocol
Network Communication
File transfer
Eg: TCP/IP, Netbean
Ethernet, telephone
Complete user visible support service
Transmit message into network between network and from segment to another
Computer must be connected



Client Tier vs Middle Tier vs Information Tier





An application consists of three main parts:
1. Form
2. Process
3. Database

Saturday, 12 March 2016

WEEK3_LAB HTML Form

today, our class do the lab exercise to create a form.

Result of question:
at the end, we must come out this Registration form as the picture above.

now is showing the HTML part for doing this form!!!

1. Name (text box)

<h1>Registrstion Form</h1> 
<form action="action_page.php">
<table border="2">
       <tr>
    <td>Name:</td>
        <td><input type="text" value="Yunalis"></td>
      </tr>
**<td> for column
    <tr>for row

2. IC No (text box)

<tr>
       <td>IC No:</td>
       <td><input type="text" name="ic no" value="870910-04-5566"></td>
</tr>

3.Address (text area)

<tr>
       <td>Address:</td>
       <td><textarea name = "message" rows="10" cols="30"></textarea></td>
</tr>

4.Gender (radio button)
<tr>
       <td>Gender:</td>
        <td><input type="radio" name="gender" value"male">Male
               <input type="radio" name="gender" value"female">Female</td>
</tr>

5.Dance Type (checkbox)

<tr>
  <td>Dance Type:</td>
        <td><input type="checkbox" name="dance1" value="Zapin">Zapin
               <input type="checkbox" name="dance2" value="Joket">Joket
               <input type="checkbox" name="dance3" value="Inang">Inang
               <input type="checkbox" name="dance4" value="Lion Dance">Lion Dance</td>
</tr>

6. Competition (select choose 1 only)

<tr>
      <td>Competiton:</td>   
      <td><select name="competition" size=3>
            <option>State Level
            <option>National Level
            <option>Internel Level
            </select>
        </td>
  </tr>

7. Nationality (multiple select)

<tr>
      <td>Nationality:</td>
      <td><select name="nationality">
             <option value="-please select">-please select</option>
             <option value="Malaysian">Malaysian</option>
             <option value="Non-Malaysia">Non-Malaysia</option>
       </select>
       <p></p><br><p></p></td>
  </tr>


8.Password (password box)

<tr>
       <td>Password:</td>
        <td><input type="password" name="psw"></td>
   </tr>

9.Register me & Cancel (submit & reset)

     <input type="submit" value="Register Me">
     <input type="reset" value="Cancel">

Monday, 7 March 2016

WEEK3_Class of HTML Form

Well, what i learning today is create a Form.

Form is divided into 2 which is 1. Action (script)
                                                  2. Method (post or get)


Compare Get and Post!!


What is INPUT? (script is <input type= "text" name)
--Text
--Password
--Radio
--Checkbox

WHY we must use this different input into form?-----this is because user friendly, to avoid client                                                                                              key in wrong data and also consistent data.


i quite confuse with two these type of input~~


Example of Radio button


Example of Checkbox


What is Select?
1. select one only
2.multiple select

Text area normally is used for address, comment and description.

Submit & Reset
<input type = “submit" value= "Go!”>
<input type = “reset" value= "Clear”>


Exercise in class!!!
1. add a drop down lists with name ="cars" to the form. Include the following option = "Volvo", "Ford", "Fiat", and "Audi".

ans:

<p>select your car
<select name = "cars">
          <option value= "volvo">Volvo
          <option value= "ford">Ford
         <option value= "fiat">Fiat
         <option value= "audi">Audi
</select>
</p>

Saturday, 5 March 2016

WEEK2 _Lab Tutorial of Dreamweaver

Well, today i learn many things in my WWW lab session.

Our lecturer give us two task which are 1. create 2 more page (Hobby and Experience)
                                                                2. link the page together

We need to change the color, font, picture. Yup, i think it is troublesome BUT i quite enjoy it when i done my work i feel proud. HAHA


I added the two more column for Hobby and Experience.





The coding when change the picture =

<tr>
    <td colspan="6"><img src="DMAS.jpg" width="1320" height="200" /></td>
  </tr>


The coding when change the color =
<tr>
     <td colspan="6" bgcolor="#000000"><div align="center" class="style1 style1">2016 Copyrights. Designed by David</div></td>
  </tr>

This is the code that i wrote in my Dreamweaver.

By the way, I enjoy it~