Forms and Files - Formula Sheet
Key PHP Form Variables
Associative arrays are used to store and access submitted form variables:
$_POST: Collects form data transmitted with the POST method. Data is stored invisibly inside the HTTP request.$_GET: Collects form data transmitted with the GET method. Data is appended directly to the URL as a visible query string.
PHP File Handling Functions
Below is the syntax and definition of parameters for the core file handling functions in PHP:
| Function & Syntax | Parameter Definitions | Return Value Description |
|---|---|---|
fopen(filename, mode) |
filename: String specifying the file path. mode: Character specifying access ('r' for read-only, 'w' for write-only/truncate, 'a' for append). |
Returns a file pointer resource on success, or FALSE on failure. |
fread(handle, length) |
handle: An active file resource opened by fopen(). length: Max bytes to read (commonly computed using filesize(filename)).
|
Returns the read string, or FALSE on failure. |
fwrite(handle, string) |
handle: Active file pointer resource. string: Text data to be written into the file. |
Returns the number of bytes written, or FALSE on failure. |
fclose(handle) |
handle: Active file pointer resource to be terminated. | Returns TRUE on success, or FALSE on failure. |
More for this chapter
Book Back Questions10 textbook MCQs · solved
Additional MCQs15 extra MCQs · solved
Practice TestInteractive · instant score
Book Back TestTest yourself on the textbook set
Additional MCQ TestTest yourself on the extra set
Study NotesConcepts & methods
More chapters in Computer Applications
View all
1 Multimedia
2 An Introduction to Adobe PageMaker
3 Introduction to Database Management System
4 PHP: Hypertext Preprocessor
5 Functions and Arrays in PHP
6 Conditional Statements in PHP
7 Loops in PHP
9 Connecting PHP and MYSQL
10 Introduction to Computer Networks
11 Network Examples and Protocols
12 Domain Name System (DNS)
13 Network Cabling
14 Open Source Concepts
15 E-Commerce
16 Electronic Payment Systems
17 E-Commerce Security Systems
18 Electronic Data Interchange- EDI