1 / 10

Form

Form. Bayu Priyambadha, S.Kom. Form. Form is the interface (user interface) for users to communicate with the application system. Each posted data from a user called the request and any results of processing by the server is called a response. HTML Form. In HTML, we use sintax :

urbano
Download Presentation

Form

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Form Bayu Priyambadha, S.Kom

  2. Form • Form is the interface (user interface) for users to communicate with the application system. • Each posted data from a user called the request and any results of processing by the server is called a response.

  3. HTML Form • In HTML, we use sintax : <form></form> • Form tag has attribute : • Action for define destination file • Method for define method used on sending request • Method : • Get • Post • Head • Put • Link • Unlink • Option • Delete • Trace • Connect

  4. Get & Post Method • Get is used to send data by request web browser to add data to url • Separate main url and data with “?”, • Separate every data with “&” www.someurl.com/this.php?data1=one&data2=two • Post is used to send data without request web browser to add data to url

  5. Read Sent Data • Read data with Get method : • Use $_GET[“name”] • Read data with Post method : • Use $_POST[“name”] Ex : <? echo $_GET[“data1”]; echo $_GET[“data2”]; ?> <? echo $_POST[“data1”]; echo $_POST[“data2”]; ?>

  6. Form Elements • There are several components that can be used in the field on the form include: • <input>, For this type of input in the form of field filling one row • <textarea>, For this type of input in the form of multi-row • <select> & <option>, For the type of input options (combo box) • Every input element have attribute named “name”, for define the name of element

  7. Input Element • Input tag has many type : • <input type="text" /> For text type • <input type="submit" /> For submit form • <input type="reset" /> For reset form • <input type="password" /> For password type • <input type="file" /> For file type • <input type="checkbox" /> For checkbox type • <input type="radio" /> For radio button type • <input type="hidden" /> For hidden input

  8. Example Form.php <form action=”proses.php” method=”GET”> <input type=”text” name=”nama”> <input type=”submit” value=”Go”> </form> Proses.php <?php echo $_GET[“nama”]; ?>

  9. Try This!!! • Buat sebuah form dengan inputan : • Berlabel “panjang”, bertipe teks • Berlabel “lebar”, bertipe teks • Tombol submit • Buat halaman penerima dengan spesifikasi : • Menerima kiriman “panjang”, diisikan pada variabel “p”, • Menerima kiriman “lebar”, diisikan pada variabel “l”, • “p” dan “l” dikalikan, hasilnya dimasukan dalam variabel “hasil”, • Variabel “hasil” dicetak.

More Related