I'm really sorry all, I've finally started a new site and decided I may not be with my current host forever so it's time to get up and runing with globals off.
I understand that if your <form method="get"> use $_GET.
If your <form method="post"> use $_POST.
What I don't understand is when I use PHP to send a variable like this for instance:
<a href = \"index.php?category=pigs\">link text here</a>
What is the variable 'pigs' sent as? Post or Get?
Thanks fo much and I do apologise for this, I can't believe after all these php years I'm asking this! (but glad to be making the step).
Please don't yell, globals off Question
Moderator: General Moderators
as you pass the data in the uri, it will be in $_GET.
meaby time to learn the difference between get and post?
The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:
- Annotation of existing resources;
- Posting a message to a bulletin board, newsgroup, mailing list,
or similar group of articles;
- Providing a block of data, such as the result of submitting a
form, to a data-handling process;
- Extending a database through an append operation.
read full explanation at http://www.w3.org/Protocols/rfc2616/rfc ... tml#sec9.3
meaby time to learn the difference between get and post?
The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:
- Annotation of existing resources;
- Posting a message to a bulletin board, newsgroup, mailing list,
or similar group of articles;
- Providing a block of data, such as the result of submitting a
form, to a data-handling process;
- Extending a database through an append operation.
read full explanation at http://www.w3.org/Protocols/rfc2616/rfc ... tml#sec9.3
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
look variable here is 'category' not 'pigs'.robster wrote:What is the variable 'pigs' sent as? Post or Get?
So you will recieve this as --
Code: Select all
$cat = $_GETї'category']; \\$cat will now contain 'pigs'- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact: