TCP connection to a particular portGET, POST, HEAD, PUT etc., where GET is most common method. Also requested
resource must be specified using URI.telnet www.uta.fi 80 Trying 153.1.6.41... Connected to www.uta.fi. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 200 OK Date: Fri, 12 Jan 2007 07:51:41 GMT Server: Apache/1.3.37 (Unix) Last-Modified: Wed, 10 Jan 2007 12:43:34 GMT ETag: "479a0-16a9-45a4df76" Accept-Ranges: bytes Content-Length: 5801 Connection: close Content-Type: text/html; charset=iso-8859-1
<form action="examples/process.php" method="GET"> <p>Name <input type="text" name="name" /> <input type="submit" value="Send" /></p> </form>Looks like in browser:
examples/process.php?name=Bill, See: Get-example
GET or POST) information
in PHP.GET, POST
and REQUEST$name = $_GET['name']; (If input is sent via GET)$name = $_POST['name']; (If input is sent via POST)$name = $_REQUEST['name']; (If input is sent via GET or POST)| Radio Buttons |
<form action="foo.php" method="POST"> <input type="radio" name="choice" value="coffee">Coffee <input type="radio" name="choice" value="tea">Tea<br/> </form> |
$ch = $_GET['choice']; |
| Check Boxes |
<form action="foo.php" method="GET"> <input type="checkbox" name="pizza"> Pizza <input type="checkbox" name="coke"> Coca-Cola<br/> </form> |
if(isset($_GET['pizza']))
{
...
}
|
| Drop-down menu: |
<form action="foo.php" method="GET"> <select name="drink"> <option>Beer</option> <option>Wine</option> </select> </form> |
$ch = $_GET['drink']; |