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??
how can I differentiate POST and GET?
Moderator: General Moderators
-
4bdulmobeen
- Forum Newbie
- Posts: 1
- Joined: Wed Jan 11, 2012 12:24 pm
Re: how can I differentiate POST and GET?
the method of the form will tell you weather it is sending data via GET or POST
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how can I differentiate POST and GET?
POST data is accessed via the $_POST associative array, same goes for $_GET;jeevanism wrote:how can I understand seeing the php code whether its code line is using GET or POST method?
Code: Select all
<?php
// data from POST
$data = $_POST['data'];
// data from GET
$gData = $_GET['gData'];
?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering