File Inclusion in PHP!
Importance Of Form
-
Form is the standard way using which a web application interacts with it’s users.
-
A web application receives input from the user via form input.
-
Handling form input is the cornerstone of a successful web application – everything else builds on it.
How Browser Passes Form Data
The browser interprets the HTML source for a
particular page:
– Result is a combination of text, images, and entry
fields
– Each entry field has a specific name
-
User fills in these fields, (with potentially some
client-side input checking via JavaScript) and
then selects a submission button
-
The browser reads the input fields, and creates
a message that is sent to the server
– A series of name, value pairs
The “Form” tag
FORM attributes
– action
- URL of the resource that receives the filled-in form.
- This is the URL of our PHP code that receives the input.
– method
- Choices are “get” or “post”.
– enctype
- MIME type used to send results. By default is application/xww-form-urlencoded.
-
Would use multipart/form-data if submitting a file (INPUT,
type=file)
<FORM action=“MyHandler.php” method=“post”>
What are “GET” and “POST” ?
-
Whenever the browser sends an HTML form data to the server , it has to follow some mechanism of sending the data.
-
Such mechanisms are called HTTP methods and the 2 most popular of them are GET and POST.
-
Thus in short we can say that GET and POST are data sending methods used by browser .