{"id":33004,"date":"2024-12-15T04:41:26","date_gmt":"2024-12-14T23:11:26","guid":{"rendered":"https:\/\/samacheerkalvi.guide\/?p=33004"},"modified":"2024-12-16T11:06:14","modified_gmt":"2024-12-16T05:36:14","slug":"samacheer-kalvi-12th-computer-applications-guide-chapter-8","status":"publish","type":"post","link":"https:\/\/samacheerkalvi.guide\/samacheer-kalvi-12th-computer-applications-guide-chapter-8\/","title":{"rendered":"Samacheer Kalvi 12th Computer Applications Guide Chapter 8 Forms and Files"},"content":{"rendered":"

Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Applications Guide<\/a> Pdf Chapter 8 Forms and Files Text Book Back Questions and Answers, Notes.<\/p>\n

Tamilnadu Samacheer Kalvi 12th Computer Applications Solutions Chapter 8 Forms and Files<\/h2>\n

12th Computer Applications Guide Forms and Files Text Book Questions and Answers<\/h3>\n

Part I<\/span><\/p>\n

Choose The Correct Answers<\/span><\/p>\n

Question 1.
\nWhen you use the $_GET variable to collect data, the data is visible to.
\na) none
\nb) only you
\nc) everyone
\nd) selected few
\nAnswer:
\nc) everyone<\/p>\n

\"Samacheer<\/p>\n

Question 2.
\nWhich one of the following should not be used while sending passwords or other sensitive information?
\na) GET
\nb) POST
\nc) REQUEST
\nd) NEXT
\nAnswer:
\na) GET<\/p>\n

Question 3.
\nWhich directive determines whether PHP scripts on the server can accept file up\u00acloads?
\na) file_uploads
\nb) file_upload
\nc) file_input
\nd) fiie_intake
\nAnswer:
\na) file_uploads<\/p>\n

Question 4.
\nIn HTML form cinput type=”text”> is used for
\na) One line text
\nb) Block of text
\nc) One paragraph
\nd) None
\nAnswer:
\na) One line text<\/p>\n

\"Samacheer<\/p>\n

Question 5.
\nHTML classes that are already defined and allow us to apply styles on it are called as
\na) Pseudo classes
\nb) Css classes
\nc) Javascript classes
\nd) None
\nAnswer:
\nb) Css classes<\/p>\n

Question 6.
\nIf you would like to read a file character by character which function do you use?
\na) fopen ()
\nb) fread ()
\nc) fgetc ()
\nd) file ()
\nAnswer:
\nc) fgetc ()<\/p>\n

Question 7.
\nPHP is a ……………… typed language.
\na) User
\nb) Loosely
\nc) Server
\nd) System
\nAnswer:
\nb) Loosely<\/p>\n

Question 8.
\nWhat does fopen() function do in PHP?
\na) It used to open files in PHP
\nb) It used to open Remote Server
\nc) It used to open folders in PHP
\nd) It used to open Remote Computer
\nAnswer:
\na) It used to open files in PHP<\/p>\n

\"Samacheer<\/p>\n

Question 9.
\nHow PHP files can be accessed?
\na) Through Web Browser
\nb) Through HTML files
\nc) Through Web Server
\nd) All of Above
\nAnswer:
\na) Through Web Browser<\/p>\n

Question 10.
\nWhich of the following functions reads the entire contents of a file?
\na) fgets()
\nb) file_get_contents()
\nc) fread()
\nd) readfile()
\nAnswer:
\nb) file_get_contents()<\/p>\n

Part II<\/span><\/p>\n

Short answers<\/span><\/p>\n

Question 1.
\nDefine HTML form controls.
\nAnswer:<\/p>\n

    \n
  • Text inputs contain textbox and text area controls,<\/li>\n
  • Buttons may contain Submit button, Reset but-ton and Cancel Button,<\/li>\n
  • Checkbox is the important feature which selects more than one value from the HTML form,<\/li>\n
  • Radio box is simiiar to checkbox but one value can be chosen at a time,<\/li>\n
  • File select is the best feature to select one file from the local machine to server machine at a time.<\/li>\n
  • Form tag is used to mention a method (POST or GET) and control the entire form controls in the HTML document.<\/li>\n<\/ul>\n

    Question 2.
    \nDefine for Form Handling method in PHP.
    \nAnswer:<\/p>\n

      \n
    • Form tag is used to mention a method (POST or GET) and control the entire form controls in the HTML document.<\/li>\n
    • All input values are synchronized and sent to the server via the POST or GET method.<\/li>\n<\/ul>\n

      \"Samacheer<\/p>\n

      Question 3.
      \nWhat is Form Validation In RHP?
      \nAnswer:<\/p>\n

        \n
      • Validation is a process of checking the input data submitted by the user from the client machine.<\/li>\n
      • There are two types of validation available in PHP. They are as follows, Client-Side Validation, Server Side Validation.<\/li>\n<\/ul>\n

        Question 4.
        \nList out HTML control to support PHP language.
        \nAnswer:<\/p>\n

          \n
        • Text inputs<\/li>\n
        • Buttons<\/li>\n
        • Checkbox<\/li>\n
        • Radio box<\/li>\n
        • File Select<\/li>\n
        • Form Tag<\/li>\n<\/ul>\n

          Question 5.
          \nWrite Syntax of Text box in HTML,
          \nAnswer:<\/p>\n\n\n\n\n
          Type<\/td>\nDescription<\/td>\n<\/tr>\n
          <input type=”text”><\/td>\nDefines a one-line text input field<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

          \"Samacheer<\/p>\n

          Question 6.
          \nDefine File handling in PHP.
          \nAnswer:
          \nFiles: File handling is an important activity of all web application development process.
          \nFiles are processed for different tasks using the following events:<\/p>\n

            \n
          1. PHP Open a File<\/li>\n
          2. PHP Read a File<\/li>\n
          3. PHP Close a File<\/li>\n
          4. PHP Write a File<\/li>\n
          5. PHP Appending a File and<\/li>\n
          6. PHP uploading a File.<\/li>\n<\/ol>\n

            Question 7.
            \nDefine Browse button in HTML.
            \nAnswer:<\/p>\n

              \n
            • It is one of the types of button, which is used to upload a single file or multiple files.<\/li>\n
            • The <input type=”file”> defines a file-select field and a “Browse” button for file uploads.<\/li>\n
            • To define a file-select field that allows multiple files to be selected, add the “multiple” attribute.<\/li>\n<\/ul>\n

              Question 8.
              \nWrite Syntax of Browse button in HTML.
              \nAnswer:
              \nSyntax:
              \ncinput type=”file” name=”myFile”><\/p>\n

              Question 9.
              \nCompare Text box and Text area
              \nAnswer:<\/p>\n\n\n\n\n\n
              Text box<\/td>\nText Area<\/td>\n<\/tr>\n
              They are generally used for collecting information such as names, email ad\u00addresses, URLs, etc.<\/td>\nThese are larger versions of the TEXT BOX. They give more room for visi\u00adtors input. TEXTAREAs are generally used to gather feedback or comments.<\/td>\n<\/tr>\n
              The <input> tag specifies an input field where the user can enter data.<\/td>\nThe <textarea> tag defines a multi-line text input control.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

              \"Samacheer<\/p>\n

              Question 10.
              \nUsage of File open function.
              \nAnswer:<\/p>\n

                \n
              1. fopen( ) is a system function available in PHP.<\/li>\n
              2. This function helps to open a file in the server.<\/li>\n
              3. It contains two parameters one for the file and the other one specifies in which mode the file should be opened (Read\/Write).<\/li>\n<\/ol>\n

                Part III<\/span><\/p>\n

                Explain in brief answer<\/span><\/p>\n

                Question 1.
                \nWrite the features Form Handling.
                \nAnswer:<\/p>\n

                  \n
                • HTML Forms are required, when you want to collect some data from the site visitor.<\/li>\n
                • A form will take input from the site visitor and then will post it to a back-end application such as CGI, ASP Script or PHP script etc.<\/li>\n
                • The back-end application will perform required processing on the passed data based on defined business logic inside the application.<\/li>\n<\/ul>\n

                  Question 2.
                  \nWrite the purpose Get method and Post method.
                  \nAnswer:
                  \nAll input values are synchronized and sent to the server via POST method or GET method. Method is an attribute form tag in HTML. Once the data reaches the server, two PHP variables such as $_POST and $_GET collects the data and prepares the response accordingly.<\/p>\n

                  Post Method:
                  \nThe input data sent to the server with POST method is stored in the request body of the client\u2019s HTTP request.<\/p>\n

                  Get Method:
                  \nThe input data sent to the server with POST method via URL address is known as query string. All input data are visible by user after they clicks the submit button.<\/p>\n

                  Question 3.
                  \nDifferentiate Get and Post Method
                  \nAnswer:<\/p>\n\n\n\n\n\n\n
                  Get Method<\/td>\n\n

                  Post method<\/p>\n<\/td>\n<\/tr>\n

                  It is designed to get data from server<\/td>\nIt is designed to send data to the server<\/td>\n<\/tr>\n
                  It is suitable to carry limited data<\/td>\nIt can carry unlimited of data<\/td>\n<\/tr>\n
                  Faster to send the re\u00adquest<\/td>\nIt is little slow compare to get method<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

                  \"Samacheer<\/p>\n

                  Question 4.
                  \nWrite short notes on File handling.
                  \nAnswer:<\/p>\n

                    \n
                  • File handling is an important activity of all web application development process.<\/li>\n
                  • It is needed for any application. For some tasks to be done file needs to be processed.<\/li>\n
                  • File handling in PHP is similar as file handling is done by using any programming language.<\/li>\n<\/ul>\n

                    Question 5.
                    \nWrite short notes on File handling functions.
                    \nAnswer:<\/p>\n

                      \n
                    1. fopen( ) – PHP Open a File<\/li>\n
                    2. fread( ) – PHP Read a File,<\/li>\n
                    3. fclose( ) – PHP Close a File,<\/li>\n
                    4. fwrite( ) – PHP Write a File,<\/li>\n
                    5. file_put_contents( ) – PHP Appending a File<\/li>\n<\/ol>\n

                      \"Samacheer<\/p>\n

                      Part IV<\/span><\/p>\n

                      Explain in detail<\/span><\/p>\n

                      Question 1.
                      \nExplain Form handling methods.
                      \nAnswer:
                      \nPHP Basic Form Handling<\/p>\n

                        \n
                      • When the user keying the input data in HTML controls and clicks the submit button the request will be generated and reaches a PHP file which is mentioned in the FORM tag under the Action attribute.<\/li>\n
                      • All input values are synchronized and sent to the server via POST method or GET method.<\/li>\n
                      • Method is an attribute form tag in HTML. Once the data reaches the server, two PHP variables such as $_POST and $_GET collects the data and prepares the response accordingly.<\/li>\n<\/ul>\n

                        Post Method:<\/p>\n

                          \n
                        • The input data sent to the server with POST method is stored in the request body of the client’s HTTP request.<\/li>\n<\/ul>\n

                          Get Method:<\/p>\n

                            \n
                          • The input data sent to the server with POST method via URL address is known as query string.<\/li>\n
                          • All input data are visible by user after they clicks the submit button.<\/li>\n<\/ul>\n

                            Question 2.
                            \nDiscuss in detail about HTML form controls.
                            \nAnswer:<\/p>\n\n\n\n\n\n\n\n\n\n\n
                            Value of type attribute<\/td>\nDescription<\/td>\n<\/tr>\n
                            Text<\/td>\nCreate a Text Box.
                            \nThe element used to get all kind of text input such as name, address etc.,<\/td>\n<\/tr>\n
                            Password<\/td>\nSimilar as Text box.<\/p>\n

                            But, while entering data, the characters are appearing as coded symbois such as asterisk.<\/td>\n<\/tr>\n

                            Checkbox<\/td>\nCheck box is an element appearing like a small square box. When the user dick on the square a tiny tick mark will appear inside the square.
                            \nThis element is used to select multiple options.<\/td>\n<\/tr>\n
                            Radio Button<\/td>\nRadio button is used to select any one of the multiple options from the list.
                            \nThis element locks like a small circle, when the user select an item, a tiny dot will appear within the circle.
                            \nIf the user selects another option, previously selected option will be deselected. This means, user can select any one of the given option form a group.<\/td>\n<\/tr>\n
                            Reset<\/td>\nIt is a special command button used to dear ail the entries made in the form.<\/td>\n<\/tr>\n
                            Submit<\/td>\nIt is also a special command button used to submit all the entries made in the form to the backend server.<\/td>\n<\/tr>\n
                            Button<\/td>\nThis is a standard graphical button on the form used to call functions on click.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

                            \"Samacheer<\/p>\n

                            Question 3.
                            \nExplain the process File handling.
                            \nAnswer:<\/p>\n

                              \n
                            • File handling is an important part of any web ap\u00acplication. You often need to open and process a file for different tasks.<\/li>\n
                            • File handling is needed for any application. For some tasks to be done file needs to be processed.<\/li>\n
                            • File handling in RHP is similar as file handling is done by using any programming language like C.<\/li>\n<\/ul>\n

                              Five major operations can he performed on file are:<\/p>\n

                                \n
                              • Creation of a new file.<\/li>\n
                              • Opening an existing file.<\/li>\n
                              • Reading data from a file.<\/li>\n
                              • Writing data in a file.<\/li>\n
                              • Closing a file.<\/li>\n<\/ul>\n

                                Steps for Processing a Fite<\/p>\n

                                  \n
                                • Declare a file pointer variable.<\/li>\n
                                • Open a file using open() function.<\/li>\n
                                • Process the file using the suitable function.<\/li>\n
                                • Close the file using fclose() function.<\/li>\n<\/ul>\n

                                  Question 4.
                                  \nExplain concepts of HTTP Uploading process.
                                  \nAnswer:
                                  \nFile Upload:<\/p>\n

                                    \n
                                  1. File upload is the best feature to select one file from the local machine to server machine. Form tag is used to mention a method as POST or GET and encrypt attribute mentioned as \u201cmultipart\/form-data\u201d.<\/li>\n
                                  2. In the <Input> tag mention type=\u201dfile\u201d attribute shows the input field as a file-select control, with a \u201cBrowse\u201d button next to the input control.<\/li>\n
                                  3. The form above sends data to a file called \u201cStudent_photo_upload.php\u201d.<\/li>\n
                                  4. First, ensure that PHP is configured to allow file uploads.<\/li>\n
                                  5. In Server machine \u201cphp.ini\u201d file, search for the file_uploads directive, and set it to On: \u201cfile_upIoads = On\u201d<\/li>\n
                                  6. After submitting the upload button the request reaches to Student_photo_upload.php file. In the file $_FILES variable collects all uploaded file information such as the name of the file, size of the file and extension of the file etc.<\/li>\n
                                  7. All the details are checked thoroughly and the errors are saved in an array variable.<\/li>\n
                                  8. The file finally moves under the image directory if the array error variable is empty.<\/li>\n<\/ol>\n

                                    \"Samacheer<\/p>\n

                                    Question 5.
                                    \nExplain in detail of File handling functions.
                                    \nAnswer:<\/p>\n

                                      \n
                                    • PHP Manipulating Files: PHP has several functions for creating, reading, uploading, and editing files.<\/li>\n
                                    • PHP readfile() Function: The readfile() function reads a file and writes it to the output buffer.<\/li>\n
                                    • PHP Open File – fopen(): A better method to open files is with the fopen() function.
                                      \nThis function gives you more options than the readfile() function.<\/li>\n
                                    • PHP Read File – read(): The fread() function reads from an open file.<\/li>\n
                                    • PHP Close File – close(): The fclose() function is used to close an open file.<\/li>\n
                                    • PHP Create File – fopen(): The fopen() function is also used to create a file.<\/li>\n
                                    • Maybe a little confusing, but in PHP. a file is created using the same function used to open files.<\/li>\n
                                    • PHP Write to File – write(): The fwrite() function is used to write to a file.<\/li>\n<\/ul>\n

                                      12th Computer Applications Guide Forms and Files Additional Important Questions and Answers<\/h3>\n

                                      Part A<\/span><\/p>\n

                                      Choose the correct answers:<\/span><\/p>\n

                                      Question 1.
                                      \nThe main objective of PHP and HTML form controls are …………..
                                      \na) To collect data from users.
                                      \nb) To create data from users.
                                      \nc) To delete data from users.
                                      \nd) to manipulate data from users.
                                      \nAnswer:
                                      \na) To collect data from users.<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 2.
                                      \nPick the odd one out.
                                      \n(a) Submit
                                      \n(b) Reset
                                      \n(c) File
                                      \n(d) Cancel
                                      \nAnswer:
                                      \n(c) File<\/p>\n

                                      Question 3.
                                      \nMatch the following:
                                      \n(A) Check box – (1) Query String
                                      \n(B) Email – (2) Client’s Request
                                      \n(C) POST – (3) Should require @ and .strings
                                      \n(D) GET – (4) Must be checkable minimum one value
                                      \n\"Samacheer
                                      \nAnswer:
                                      \n(D) GET – (4) Must be checkable minimum one value<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 4.
                                      \n…………………………. is used to select one value can be chosen at a time.
                                      \n(a) Checkbox
                                      \n(b) Radio box
                                      \n(c) Textbox
                                      \n(d) File
                                      \nAnswer:
                                      \n(b) Radio box<\/p>\n

                                      Question 5.
                                      \n…………….. and ……………. are the most important concepts that the PHP web development processes.
                                      \na) Forms and files
                                      \nb) Tables and Links
                                      \nc) Both a and b
                                      \nd) None of these
                                      \nAnswer:
                                      \na) Forms and files<\/p>\n

                                      Question 6.
                                      \n……………. is a process of checking the input data submitted by the user from the client machine.
                                      \na) File
                                      \nb) Form
                                      \nc) Validation
                                      \nd) All of these
                                      \nAnswer:
                                      \nc) Validation<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 7.
                                      \nWhich tag is used to mention POST or GET method?
                                      \n(a) Frame
                                      \n(b) Form
                                      \n(c) File
                                      \n(d) Input
                                      \nAnswer:
                                      \n(b) Form<\/p>\n

                                      Question 8.
                                      \nWhich of the following is a back-end application?
                                      \na) CGI
                                      \nb) ASP Script
                                      \nc) PHP Script
                                      \nd) All of these
                                      \nAnswer:
                                      \nd) All of these<\/p>\n

                                      Question 9.
                                      \n……………….. is the best feature to select one file from the local machine to server machine,
                                      \na) File upload
                                      \nb) Files
                                      \nc) Forms
                                      \nd) All of these
                                      \nAnswer:
                                      \na) File upload<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 10.
                                      \n………………………. is a process of checking the input data submitted by the user from the client machine.
                                      \n(a) collection
                                      \n(b) verification
                                      \n(c) validation
                                      \n(d) Report
                                      \nAnswer:
                                      \n(c) validation<\/p>\n

                                      Choose odd man out:<\/span><\/p>\n

                                      1. a) Submit
                                      \nb) Cancel
                                      \nc) File select
                                      \nd) Reset
                                      \nAnswer:
                                      \nc) File select<\/p>\n

                                      2. a) file_put_contents()
                                      \nb) fopen ()
                                      \nc) fread ()
                                      \nd) fgetc ()
                                      \nAnswer:
                                      \nd) fgetc ()<\/p>\n

                                      \"Samacheer<\/p>\n

                                      3. a) Append
                                      \nb) Frame
                                      \nc) File select
                                      \nd) Form Tag
                                      \nAnswer:
                                      \na) Append<\/p>\n

                                      4. a) File
                                      \nb) Data
                                      \nc) Mode
                                      \nd) Action
                                      \nAnswer:
                                      \nd) Action<\/p>\n

                                      5. a) PHP
                                      \nb) AJAX
                                      \nc) JSP
                                      \nd) ASP
                                      \nAnswer:
                                      \nb) AJAX<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Very Short Answers<\/span><\/p>\n

                                      Question 1.
                                      \nGive the syntax for fopen( ) function?
                                      \nAnswer:
                                      \nSyntax:
                                      \n$file_Object= fopen(\u201cFileName\u201d, \u201cReadAVriteMode\u201d) or die(\u201cError Message!\u201d);<\/p>\n

                                      Question 2.
                                      \nWhat is the main objective of PHP and HTML?
                                      \nAnswer:
                                      \nThe main objective of PHP and HTML form controls is to collect data from users.<\/p>\n

                                      Question 3.
                                      \nWhat is fopen() function?
                                      \nfopen() is a system function available in PHP.<\/p>\n

                                      Question 4.
                                      \nWhat is the purpose of fopen() function?
                                      \nAnswer:
                                      \nfopen function helps to open a file in the server.<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 5.
                                      \nHow many parameters are there in fopen() function?
                                      \nAnswer:
                                      \nThere are two parameters in fopen() function.<\/p>\n

                                      Question 6.
                                      \nWhat is the purpose of fread() function?
                                      \nAnswer:
                                      \nThe fread() function reads from an open file.<\/p>\n

                                      Question 7.
                                      \nHow files are uploaded to the server?
                                      \nAnswer:
                                      \nA PHP script can be used with an HTML form to allow users to upload files to the server.<\/p>\n

                                      Question 8.
                                      \nWhat is file handling?
                                      \nAnswer:
                                      \nFile handling is used to open and process a file for different tasks.<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 9.
                                      \nWhat is the purpose of form validation?
                                      \nAnswer:
                                      \nTo protect your form from hackers and spammers!<\/p>\n

                                      Question 10.
                                      \nWhat is HTML?
                                      \nAnswer:
                                      \nHTML is the standard markup language for creating web pages and web applications.<\/p>\n

                                      Question 11.
                                      \nExpand HTML.
                                      \nAnswer:
                                      \nHTML stands Hypertext Markup Language.<\/p>\n

                                      Question 12.
                                      \nWhat are the methods to be used to upload data?
                                      \nAnswer:
                                      \nGET and POST methods are used to upload the data most frequently.<\/p>\n

                                      Question 13.
                                      \nWhat is the purpose of encrypting attribute?
                                      \nAnswer:
                                      \nThis attribute is used to specify, how the browser encodes the data before it sends it to the server.<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 14.
                                      \nExpand AJAX.
                                      \nAnswer:
                                      \nAsynchronous JavaScript And XML.<\/p>\n

                                      Question 15.
                                      \nIS AJAX, a programming language?
                                      \nAnswer:
                                      \nAJAX is not a programming language.<\/p>\n

                                      Match the following:<\/span><\/p>\n

                                      1. Text – More than one value
                                      \n2. Buttons – Only one value
                                      \n3. Checkbox – Post and Get
                                      \n4. Radio box – Select file
                                      \n5. File Select – Submit Reset and Cancel.
                                      \n6. Form – Textbox and text area
                                      \n7. URL address – _blank, _se!f, __parent
                                      \n8. Target window – Query string
                                      \n9. file_put_contents() – php.ini
                                      \n10. Server machine – Append
                                      \nAnswer:
                                      \n1. Textbox and text area
                                      \n2. Submit, Reset and Cancel.
                                      \n3. More than one value
                                      \n4. Only one value
                                      \n5. Select file
                                      \n6. Post and Get
                                      \n7. Query string
                                      \n8. _blank, _self, _parent
                                      \n9. Append
                                      \n10. php.ini<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Syntax<\/span><\/p>\n

                                      1. fopen():
                                      \n$file_Object= fopen(“FileName”, “Read\/Write-Mode”) or die(“Error Message!”);<\/p>\n

                                      2. fread():
                                      \nfread($file_Object,filesize(“FileName”));<\/p>\n

                                      3. fcloseQ:
                                      \nfclose($file_Object);<\/p>\n

                                      4. fwriteQ:
                                      \nfwrite($myfile, $txt);<\/p>\n

                                      Additional programs using forms:<\/p>\n

                                      1. Sample’PHP program to open and dosing a file:
                                      \ni) Text(Notepad) file:
                                      \nAJAX = Asynchronous JavaScript and XML CSS = Cascading Style Sheets HTML = Hyper Text Markup Language PHP = PHP Hypertext Preprocessor SQL = Structured Query Language SVG = Scalable Vector Graphics XML = Extensible Markup Language<\/p>\n

                                      ii) PHP File:
                                      \n<?php
                                      \n$myfile = fopen(“webdictionary.txt”, “r”) or dieC’Unable to open file!”); echo fread($myfile,filesize(“webdictionary. txt”)); fclose($myfile);
                                      \n?><\/p>\n

                                      \"Samacheer<\/p>\n

                                      iii) OUTPUT
                                      \nAJAX = Asynchronous JavaScript and XML CSS = Cascading Style Sheets HTML = Hyper Text Markup Language PHP = PHP Hypertext Preprocessor SQL = Structured Query Language SVG = Scalable Vector Graphics XML = Extensible Markup Language<\/p>\n

                                      2. An HTML code to demonstrate Form and Form controls (Login form)
                                      \n<html>
                                      \n<head>
                                      \n<title> Login Form <\/title>
                                      \n<body>
                                      \n<h3 align=center> TamilNadu State Council of Educational Research and Training, Chennai <\/h3>
                                      \n<Form Action = “mailto:abcd.xyz@com” method=post >
                                      \n<p> User Name:
                                      \n<Input type = text name=”user_name” size = 20 maxlength = 15> <\/p>
                                      \n<p> Password:
                                      \nclnputtype = password name=”pass”size = 20 maxlength = 15> <\/p>
                                      \n<Input type = reset value = “Clear”>
                                      \n<Input type = submit value = “Login”> <\/Form>
                                      \n<\/body>
                                      \n<\/html>
                                      \nOutput:
                                      \n\"Samacheer<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Part B\u00a0<\/span><\/p>\n

                                      Short Answers<\/span><\/p>\n

                                      Question 1.
                                      \nWrite a note on client-side validation?
                                      \nAnswer:
                                      \nClient-Side Validation: The input data validations are performed on the client machine\u2019s web browsers using client-side scripts like Javascript or adding \u201crequired\u201d attributes in HTML input tags.<\/p>\n

                                      Question 2.
                                      \nWhat is the process of Server Side Validation:
                                      \nAnswer:
                                      \nAfter the submission of data, validations are performed on the server-side using programming like PHP, ASP, or JSP, etc. available in the server machine.<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Brief Answers<\/span><\/p>\n

                                      Question 1.
                                      \nWrite the Validation rules for HTML input fields.
                                      \nAnswer:
                                      \nValidation rules for HTML input field
                                      \nName (Text Input) : Should require letters and white-spaces
                                      \nEmail (Text Input) : Should require @ and .strings
                                      \nWebsite (Text Input) : Should require a valid URL
                                      \nRadio: Must be selectable minimum one value
                                      \nCheck Box: Must be checkable minimum one value
                                      \nDrop-Down Menu: Must be selectable minimum one value<\/p>\n

                                      \"Samacheer<\/p>\n

                                      Question 2.
                                      \nExplain briefly about fopen() function.
                                      \nAnswer:
                                      \nPHP Open a File<\/p>\n

                                        \n
                                      • fopen() is a system function available in PHP.<\/li>\n
                                      • This function helps to open a file in the server.<\/li>\n
                                      • It contains two parameters one for the file and the other one specifies in which mode the file should be opened (Read\/Write).<\/li>\n<\/ul>\n

                                        Syntax:
                                        \n$file_Object= fopen(“FileName” “Read\/WriteMode”) or dieC’Error Message!”);
                                        \nExample:
                                        \n<?php
                                        \n$myfile = fopen(“Student.txt”, “r”) or
                                        \ndie(“Unable to open file!”);
                                        \n?><\/p>\n

                                        \"Samacheer<\/p>\n

                                        Question 3.
                                        \nExplain briefly about fread() function.
                                        \nAnswer:
                                        \nPHP Read a File:
                                        \nThe fread() function reads from an open file. The file object comes from fopen function.<\/p>\n

                                        Syntax:
                                        \nfread($file_Object,filesize(“FileName”));<\/p>\n

                                        Example:
                                        \n<?php
                                        \nfread($myfile,filesize(“Student.txt”));
                                        \n?><\/p>\n

                                        Question 4.
                                        \nExplain briefly about fclose() function.
                                        \nAnswer:
                                        \nPHP Close a File:
                                        \nThe fclose() function is used to close an opened file.
                                        \nThe file object comes from fopen function.<\/p>\n

                                        Syntax:
                                        \nfclose($file_Object);<\/p>\n

                                        Example:
                                        \n<?php
                                        \n$myfile = fopenC’student.txt”, “r”);
                                        \n\/\/ some code to be executed….
                                        \nfclose($myfile);
                                        \n?><\/p>\n

                                        \"Samacheer<\/p>\n

                                        Question 5.
                                        \nExplain briefly about fwrite() function.
                                        \nAnswer:
                                        \nPHP write a File:
                                        \nThe fwrite() function is used to write to a file.<\/p>\n

                                        Syntax:
                                        \nfwrite($myfile, $txt);<\/p>\n

                                        Example:
                                        \n<?php
                                        \n$myfile = fopen(“new_schooL_file.txt”, “w”)
                                        \nor dieC’Unable to open file!”);
                                        \n$txt = “School Name\\n”;
                                        \nfwrite($myfile, $txt);
                                        \n$txt = “Student Name\\n”;
                                        \nfwrite($myfile, $txt);
                                        \nfclose($myfile);
                                        \n?><\/p>\n

                                        Question 6.
                                        \nWrite a short note on Appending a File
                                        \nAnswer:
                                        \nThe file_put_contents() function is used to Ap-
                                        \npend to a file.<\/p>\n

                                        Syntax:
                                        \nfile_put_contents(file,data,mode,context)<\/p>\n

                                        Example:
                                        \n<?php
                                        \n$txt = “Student id “;
                                        \n$myfile = file_put_contentsClogs.txt’, $txt.
                                        \nPHP_EOL , FILE_APPEND | LOCK_EX);
                                        \n?><\/p>\n

                                        \"Samacheer<\/p>\n

                                        Part D<\/span><\/p>\n

                                        Detailed Answers<\/span><\/p>\n

                                        Question 1.
                                        \nExplain the file uploading method in PHP.
                                        \nAnswer:<\/p>\n

                                          \n
                                        • File upload is the best feature to select one file from the local machine to the server machine.<\/li>\n
                                        • The form tag is used to mention a method as POST or GET and encrypt attribute mentioned as “multipart\/form-data”.<\/li>\n
                                        • In the <Input> tag mention type=”file” attribute shows the input field as a file-select control, with a “Browse” button next to the input control.<\/li>\n
                                        • The form above sends data to a file.<\/li>\n
                                        • In Server machine “php.ini” file, search for the file_uploads directive, and set it to On: “file_up- loads = On”<\/li>\n
                                        • After submitting the upload button the request reaches the file.<\/li>\n
                                        • In the file $_FILES variable collects all uploaded file information such as the name of the file, size of the file and extension of the file, etc.<\/li>\n
                                        • All the details are checked thoroughly and the errors are saved in an array variable.<\/li>\n
                                        • The file finally moves under the image directory if the array error variable is empty.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"

                                          Tamilnadu State Board New Syllabus Samacheer Kalvi 12th Computer Applications Guide Pdf Chapter 8 Forms and Files Text Book Back Questions and Answers, Notes. Tamilnadu Samacheer Kalvi 12th Computer Applications Solutions Chapter 8 Forms and Files 12th Computer Applications Guide Forms and Files Text Book Questions and Answers Part I Choose The Correct Answers Question …<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[5],"tags":[],"class_list":["post-33004","post","type-post","status-publish","format-standard","hentry","category-class-12"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/posts\/33004"}],"collection":[{"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/comments?post=33004"}],"version-history":[{"count":1,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/posts\/33004\/revisions"}],"predecessor-version":[{"id":41634,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/posts\/33004\/revisions\/41634"}],"wp:attachment":[{"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/media?parent=33004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/categories?post=33004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samacheerkalvi.guide\/wp-json\/wp\/v2\/tags?post=33004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}