Spiga

PHP Interview Questions - Part 1

1. What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?
In the get method the data made available to the action page ( where data is received ) by the URL so data can be seen in the address bar. Not advisable if you are sending login info like password etc.

In the post method the data will be available as data blocks and not as query string.

2.What is GPC?
G – Get
P – Post
C – Cookies

3. What are super global arrays?
All variables that come into PHP arrive inside one of several special arrays known collectively as the superglobals. They're called superglobal because they are available everywhere in your script, even inside classes and functions.

4. Give some example for super global arrays?
$GLOBALS
$_GET
$_POST
$_SESSION
$_COOKIE
$_REQUEST
$_ENV
$_SERVER