Page 1 of 1

how can I differentiate POST and GET?

Posted: Fri Jan 27, 2012 4:07 am
by jeevanism
I am so newbie to the php , consider a dummy. I have this doubt always. How can I differentiate a GET and POST when I see the source code? I just know this GET pass plain url while POST wont. so POST is more secure than GET. besides this, how can I understand seeing the php code whether its code line is using GET or POST method?


Any help??

Re: how can I differentiate POST and GET?

Posted: Fri Jan 27, 2012 6:05 am
by 4bdulmobeen
the method of the form will tell you weather it is sending data via GET or POST

Re: how can I differentiate POST and GET?

Posted: Fri Jan 27, 2012 8:03 am
by social_experiment
jeevanism wrote:how can I understand seeing the php code whether its code line is using GET or POST method?
POST data is accessed via the $_POST associative array, same goes for $_GET;

Code: Select all

<?php
 // data from POST
 $data = $_POST['data'];
 
 // data from GET
 $gData = $_GET['gData'];
?>