Posts

WEEK 13 - PHP (QUIZ)

Image
In this week, we having our last quiz attempt in WWW Programming class. This quiz is to test our skill on writing java script. First, our lecturer provide a result for us. We need to develop a page with same result given by lecturer. Here is the result that I get ...

WEEK 12 - Connect the server with browser

Image
In this week, we learn about how to connecting the database server with the browser. The example we take is from w3school. After that we enter the data based on our database. First we need to create a table in php, purpose to show a simple interface to present the database. The following is the code to present the database <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> #customers {     font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;     border-collapse: collapse;     width: 100%; } #customers td, #customers th {     border: 1px solid #ddd;     padding: 8px; } #customers tr:nth-child(even){background-color: #f2f2f2;} #customers tr:hover {background-color: #ddd;} #customers th {     padding-top: 12px;     padding-bottom: 12px;     text-align: left;     background-color: #4CAF50;     color: white; } </style> </head> <bod

WEEK 11 - PHP (Lab Activity)

Image
This week the class continue with the previous class which we follow the sample database given by lecturer and we enter it into xampp. At the end of the class , we need to export both sql document name it as dbgui and dbsql Example on how to create table on xampp.

WEEK 10 - PHP Form

Image
In this week learn about how to create a php form and how to put php validation to secure the form.First ,we use the example provide in w3school.com .After that, lecturer give us a data to key- in in database. Before that, we need to connect the XAMPP and create the table, after that key-in all the data inside the table.  Example of data INPUT : < !DOCTYPE  HTML >    < html > < head > < /head > < body >    <?php // define variables and set to empty values $name = $email = $gender = $comment = $website =  "" ; if  ( $_SERVER [ "REQUEST_METHOD" ] ==  "POST" ) {   $name = test_input( $_POST [ "name" ]);   $email = test_input( $_POST [ "email" ]);   $website = test_input( $_POST [ "website" ]);   $comment = test_input( $_POST [ "comment" ]);   $gender = test_input( $_POST [ "gender" ]); } function  test_input($data) {   $data = trim($data);   $data = stripslashes(

WEEK 9 - PHP Exercise

By using PHP form is really good at handling the data and submitted to the server in HTML forms. Its allow user to enter their data into the webpage, on the server we can use PHP page along with the form collection to handle the information set. For example, <Form METHOD= "GET"           ACTION= "process.php"> Two main attribute in form are : 1. METHOD - Get/post 2.ACTION - use to specify the target which is where the data is to be transmitted. - Typically the target is a file that contain code for processing In this week class, we learn about how to use echo and print statement in PHP.  We take the example from w3school and we go through it. The different between echo and print Echo and print are more or less the same. They are both used to output data to the screen. The differences are small: echo has no return value while print has a return value of 1 so it can be used in expressions. echo can take multiple parameters (although such u

WEEK 7 - Introduction to PHP

Today class is briefly explain what is php and how it work with web browser and server. After that, we have to identify the data type and valid syntax use in Php. Php is a simple programming language  use to develop compare to Java, C, python and many others. Php support a variety of different database system that include MySQL, Informix, Oracle, Sybase and so on... How php script are accessed and interpreted? 1. User access PHP file 2. User request for PHP file 3. Receive request,find file and read it. 4. Execute PHP script/code 5. Send result back 6. Return results. In this chapter we learn that every php must include this three special markup tag i. <?php      php code      ?> ii. <?          php code      ?> iii. <script language = "php"    php code    </script> All variable in php must begin with $ ( dollar  sign)

WEEK 6 - Introduction to Java Script

Image
Java script is a document help the web designer to build more functional and interactive website. For example, popup window, alert message, form validation, etc. are common use by the developer. In this week, our lecturer teach us on how to form a java script in html document. First, we use this code from lecturer slide. Exercise 1 INPUT: <html><head><title> JAVA SCRIPT</title></head> <body> <h1> Welcome to SMMTC </h1>  This is HTML section.... </body> </html> <script type="text/javascript">   window.alert("welcome to JavaScript!"); </script> OUTPUT: Exercise 2 INPUT: <html><head><title> JAVA SCRIPT</title> <script type="text/javascript">   function showText() {       window.alert("welcome to JavaScript!");   } </script></head> <body  onload="showText();"> <h1> Welcome to SMMTC </h