Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 10th Dec 2013, 09:57 AM   #1
Warrior Member
 
Join Date: 2013
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

I want get the difference please tell actual

aircompressor007 is offline  
Unread 10th Dec 2013, 08:02 PM   #2
VIP Warrior
 
mojojuju's Avatar
 
Join Date: 2005
Location: Potemkin Village
Posts: 1,724
Thanks: 745
Thanked 742 Times in 498 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

There's some good answers here: http://stackoverflow.com/questions/1...n-get-and-post

:)
mojojuju is offline  
Unread 11th Dec 2013, 06:51 AM   #3
Warrior Member
 
Join Date: 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

GET is the data sent to the server in the URL:
For example:
SOMETHIGN.com?a1=data&a2=moredata

so the server get's the array: [a1=>data, a2=>moredata]

Post is data sent through the HTTP and it is not visual to the user.
XTractor is offline  
Unread 12th Dec 2013, 12:11 AM   #4
Warrior Member
 
Join Date: 2013
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

Hello
The basic difference between $_get and $_post is
In the $_get method is restricted to send upto 1024 characters only and the PHP provides $_get associative array to access all the sent information using GET method.Other hand $_Post method does not have any restriction on data size to be sent and the post method can be used to send ASCII as well as binary data.The PHP provides $_Post associative array to access all the sent information using POST method.
pawanzz is offline  
Unread 23rd Dec 2013, 06:25 AM   #5
Warrior Member
 
Join Date: 2013
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

$_GET, $_POST and $_REQUEST all these variables are predefined variables in php. Normally we have 2 methods to send the data to one page to another page. Those methods are nothing but GET and POST methods. Using this variable we can get the data by specifying the variable name for example, $_GET['name'], $_POST['email'] and $_REQUEST['phone'].

Using GET method:
we can get the data from URL
Example: www.example.com/index.php?name=phptag
Now from the above URL if you want to get the phptag value see the code below

<?php

$name = $_GET['name'];
//or
$name = $_REQUEST['name'];

?>

Using POST method:
we can get the in hidden mode, that means we cannot see the data in URL it will carry through the headers.
Normally we can use the post method by implementing the html form's see the code below

<form name='phptag' method='post'>
<input type='text' name='name' value='phptag'>
<input type='submit' name='demo' value='Click' >
</form>
<?php

$name = $_POST['name'];
//or
$name = $_REQUEST['name'];

?>
Please visit connected commerce site have used lot of post and get methods.
In the above examples the common thing that we have used is $_REQUEST which means it can be used for both GET and POST methods to get the data.

Thanks,
Roger,
connected commerce
rogerlegend is offline  
Unread 23rd Dec 2013, 07:10 AM   #6
Active Warrior
War Room Member
 
Join Date: 2013
Posts: 48
Thanks: 0
Thanked 9 Times in 9 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

Originally Posted by rogerlegend View Post

$_GET, $_POST and $_REQUEST all these variables are predefined variables in php. Normally we have 2 methods to send the data to one page to another page. Those methods are nothing but GET and POST methods. Using this variable we can get the data by specifying the variable name for example, $_GET['name'], $_POST['email'] and $_REQUEST['phone'].

Using GET method:
we can get the data from URL
Example: www.example.com/index.php?name=phptag
Now from the above URL if you want to get the phptag value see the code below

<?php

$name = $_GET['name'];
//or
$name = $_REQUEST['name'];

?>

Using POST method:
we can get the in hidden mode, that means we cannot see the data in URL it will carry through the headers.
Normally we can use the post method by implementing the html form's see the code below

<form name='phptag' method='post'>
<input type='text' name='name' value='phptag'>
<input type='submit' name='demo' value='Click' >
</form>
<?php

$name = $_POST['name'];
//or
$name = $_REQUEST['name'];

?>
Please visit connected commerce site have used lot of post and get methods.
In the above examples the common thing that we have used is $_REQUEST which means it can be used for both GET and POST methods to get the data.
not 100% correct $_REQUEST = data from $_GET, $_POST, and $_COOKIE
softwarewarden is offline  
Unread 23rd Dec 2013, 07:30 AM   #7
HyperActive Warrior
War Room Member
 
YHmuWong's Avatar
 
Join Date: 2013
Posts: 117
Thanks: 205
Thanked 14 Times in 14 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

It is mostly how the script reacts to the data.$get is pass it as visual to the user while $post is to pass it as http and hidden to the user.Obviously,$post is safer than $get protocol, who wants their information being posted on the site they visit.

Number 11 is lucky in snake & ladders.
YHmuWong is offline  
Unread 24th Dec 2013, 10:10 AM   #8
Web Developer
War Room Member
 
Andrew H's Avatar
 
Join Date: 2012
Location: Vancouver, BC
Posts: 593
Thanks: 149
Thanked 162 Times in 133 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

It amazes me how much people 'think' they know (and how positive they seem in their answers). ~%20 of information in these responses is incorrect.

$_GET = PHP: $_GET - Manual
$_POST = PHP: $_POST - Manual
$_REQUEST = PHP: $_REQUEST - Manual

"You shouldn't come here and set yourself up as the resident wizard of oz."
Andrew H is offline  
Unread 25th Dec 2013, 02:35 AM   #9
Monkey
War Room Member
 
nettiapina's Avatar
 
Join Date: 2013
Location: Vantaa, Finland
Posts: 4,324
Thanks: 336
Thanked 697 Times in 617 Posts
Default
Re: Which is the difference between $_get & $_post in PHP?
Share on: 
fb share twitter share gplus share more share

Originally Posted by YHmuWong View Post

It is mostly how the script reacts to the data. is pass it as visual to the user while is to pass it as http and hidden to the user.Obviously, is safer than protocol, who wants their information being posted on the site they visit.
POST is not much safer than GET unless there's something else to make it safer. You're still POSTing information to the site you're visiting. It's all in clear text unless you're using some form of encryption.

Sure, the variables aren't visible in your address bar, and it might be harder to get the data from your browser history, but these are just side effects.

Links in signature will not help your SEO. Not on this site, and not on any other forum.
Who told me this? An ex Google web spam engineer.

What's your excuse?
nettiapina is offline  
Closed Thread


Bookmarks

Tags
$get, $post, difference, php


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:28 PM.