12th Standard Syllabus & Materials
12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set C
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set B
NEW12th Standard
TN 12th Standard Biology Zoology - Reproduction in Organisms Creative Questions Study Material - QB365 Set A
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set C

Published on: 06/01/2020
Forms and Files
Download Tamil Nadu 12th Standard Computer Applications question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Applications Test

1.
Which of the following is not a Server side programming?
PHP
JSP
Python
All of these
2.
In the web development, user access website or web pages from ________.
Remote server machine
Remote client machine
Remote machine
All of these
3.
How PHP files can be accessed?
Through Web Browser
Through HTML files
Through Web Server
All of Above
4.
What does fopen() function do in PHP?
It used to open files in PHP
It used to open Remote Server
It used to open folders in PHP
It used to open Remote Computer
5.
When you use the \$_GET variable to collect data, the data is visible to..
none
only user
everyone
selected few
6.
What is File upload?
7.
What is the purpose of fread( ) function?
8.
What are the most important concepts in PHP development process?
9.
Write syntax of File open function.
10.
Define Browse button in HTML.
11.
Write short note on Appending a File
12.
Explain briefly about fopen( ) function
13.
Sample PHP program to open and closing a file.
14.
Explain the difference between the POST method and GET method of sending data to the server in PHP.
15.
Write the purpose Get method and Post method.
16.
Explain file uploading method in PHP.
17.
Explain in detail of File handling functions in PHP.
18.
Explain the process File handling.
19.
Explain Form Handling methods.
1.
(c)
Python
2.
(b)
Remote client machine
3.
(a)
Through Web Browser
4.
(a)
It used to open files in PHP
5.
(c)
everyone
6.
A PHP script can be used with a HTML form to allow users to upload fIles to the server
7.
The fread( ) function reads from an open file.
8.
Forms and files are most important concepts that the PHP web development processes.
9.
Syntax:
\($\)file_Object = fopen("FileName", "Read/WriteMode") or die("Error Message!");
10.
The browser button defined a file-select filed and a "Browse" button for file uploads.
11.
The file_put_contents ( ) function is used to Append to a file.
Syntax:
file_put_contents(file,data,mode,context)
Example:
< ?php
$txt = "Student id ";
$myfile = file_put_contents('logs.txt', $txt.
PHP_EOL , FILE_APPEND | LOCK_EX);
? >
12.
PHP Open a File
1. fopen( ) is a system function available in PHP.
2. This function helps to open a file in the server.
3. It contains two parameters one for the file and the other one specifies in which mode the file should be opened (Read/Write).
Syntax:
$file_Object= . fopen("FileName", "Read/ WriteMode'') or die("Error Message!'');
Example:
< ?php
$myfile = fopen("Student.txt", "r'') or die("Unable to open file!'');
? >
13.
i) Text(Notepad) file:
AJAX = 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
ii) PHP File:
< ?php
$myfile = fopen("webdictionary.txt", "r'') or
die("Unable to open file!'');
echo fread( $myfile, filesize("webdictionary.
txt'')); fclose($myfile);
? >
iii) OUTPUT
AJAX = 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
14.
| Post Method | Get Method |
| The input data sent to the server with POST method is stored in the request body of the client's HTTP request. | The 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 click the submit button. |
15.
The GET and POST methods are used for sending the data to the server and the main difference between them is that GET methods append the data to the URI defined in form's action attribute POST methods attaches data to the requested body.
16.
1. File upload is the best feature to select one file from the local machine to server machine.
2. Form tag is used to mention a method as POST or GET and encrypt attribute mentioned as "multipart/form-data".
3. 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.
4. The form above sends data to a file.
5. In Server machine "php.ini" file, search for the file_uploads directive, and set it to On: "file_uploads = On"
6. After submitting the upload button the request reaches to the file.
7. In the file $FILES variable collects all uploaded file information such as name of the file, size of the file and extension of the file etc.
8. All the details are checked thoroughly and the errors are saved in an array variable.
9. The file finally moves under the image directory if the array error variable is empty.
17.
File handling is an important activity of all web application development process.
Files are processed for different tasks using the following events :
(i) PHP Open a File,
(ii) PHP Read a File,
(iii) PHP Close a File,
(iv) PHP Write a File,
(v) PHP Appending a File and
(vi) PHP uploading a File.
(1) PHP Open a File : fopen() is a system function available in PHP. This function helps to open a file in the server. It contains two parameters one for the file and the other one specifies in which mode the file should be opened (Read/Write).
Syntax:
$file_Object= fopen("FileName", "Read/
WriteMode") or die("Error Message!");
Example:
$myfile = fopen("Student.txt", "r")
or die("Unable to open file!");
?>
(ii) PHP Read a File: The fread() function reads from an open file. The file object comes from fopen function.
Syntax:
fread($file_Object,filesize("FileName"));
Example:
fread($myfile,filesize("Student.txt"));
?>
(iii) PHP Close a File: The fclose() function is used to close an opened file. The file object comes from fopen function.
Syntax:
fclose($file_Object);
Example:
(iv) PHP write a File: The fwrite() function is used to write to a file.
Syntax:
18.
In the file handling process following task can be included
(i) open file for read and write
(ii) close file
(iii) perform operations on file
(iv) write results
With PHP we can handle file easily. There are various in built functions available for file handling for PHP.
Using file handling we can open, create, upload and edit files in PHP before working with file. We must open the file first using fopen() function.fopen() function is used in a following manner to perform this task.
$fp = fopen(
In the above code, we have used two parameters while using fopen() function.
filename to open mode in which file is to be opened.
The function will return a file pointer if the file is successfully opened, otherwise it will return false.
Modes we use in the file handling
| Mode | Description |
| r | Read only mode |
| r+ | Read and write mode |
| W | Write mode only |
| W+ | Write and read model |
| a | Append file mode |
| a+ | Read and append mode |
| x | It used to create and open a file only for writing purpose. |
19.
PHP Basic Form Handling:
(i) When the user keys in 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.
(ii) All the input values are synchronized and sent to the server via POST method or GET method. Method is an attribute of form tag in HTML.
(iii) Once the data reaches the server,two PHP variables such as \($\)_POST and \($\)_GET collects the data and prepares the response accordingly.
Post Method: The input data sent to the server with POST method is stored in the request body of the client's HTTP request.
Get Method: The 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.
Example:
Test.html:
< html >
< body >
<form action="'welcome.php" method=''post" >
Name: < input type="text" name="name'' > < br >
E-mail: < input type="text" name="email" > < br >
< input type=''submit" >
< /form >
< /body >
< /html >
Welcome.php:
< html >
< body >
Welcome < ?php echo \($\)_POST["name"]; ? > < br >
Your email address is: < ?php echo \($\)_POST["email"]; ? >
< /body >
< /html >
Output
(i) HTML File contains two Text Box (Name and Email), One Button and one form tag. The remote server PHP file (welcome.php) is mentioned in form tag under the Action Attribute.
(ii) In "Welcome.Php" file, PHP variables such as \($\)_POST and \($\)_GET collects the data and prepares the response accordingly.
(iii) Eventually the user will receive the output response in the client machine's browser screen.
12th Standard Syllabus & Materials
12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set B
NEW12th Standard
TN 12th Standard Physics Electronics and Communication Creative Questions Study Material - QB365 Set A
NEW12th Standard
TN 12th Standard Physics Wave Optics Creative Questions Study Material - QB365 Set D
NEW12th Standard
TN 12th Standard Physics Wave Optics Creative Questions Study Material - QB365 Set C
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards