Ticker

6/recent/ticker-posts

PHP (Get Method)

PHP GET METHOD
The Get method is used to send data on server by a web browser such (Internet explorer, Mozilla firefox, Google chrome, etc.) and in the GET method, data send to URL (Uniform Resource Locator) as parameters and its normally pass in string form that consisted variable name and its value, pairs separated by ampersands (&) operator.
In URL, normally the GET method's data look like this.
http://localhost/class.php?name=John&age=25










GET METHOD ADVANTAGE

a. The GET method work fast than compare of POST method.

DISADVANTAGE OF  GET METHOD
a. The GET method data always visible on URL, so its not prefer to pass sensitive information such (Username, Password, Account number, Credit, Debit card number, etc.)

b. The GET method assigns data to a server environment variables, therefore the length of URL is limited.  

EXAMPLE OF  GET METHOD

<form action="#" method="get">
Enter your name: <input type=text name=n>
<input type="submit" name="sub">
</form

<?php
if(isset($_GET['sub']))
{
echo"Your name is:".$_GET['n'];
?>




Post a Comment

0 Comments