Posts

Showing posts from November, 2017

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($d...

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 (althou...

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)