dogbot Posted March 27, 2011 Share Posted March 27, 2011 NEWBIE ALERT: New to Programming Newer to PHP Bad at formulating coherent questions.....so here it goes.... Could someone explain $fieldname = $_REQUEST['fieldname'] I understand "$_REQUEST An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE" I also understand you call the member of an array like so: <?php $arr = array("foo" => "bar", 12 => true); echo $arr["foo"]; // bar echo $arr[12]; // 1 ?> So I would expect that if someone wants to use something from the $_REQUEST Array they would use: $fieldname = $_REQUEST['$_GET'] So I do not understand why "$fieldname" is inside the brackets.I suspect they might be setting this up to use $fieldname instead of $_REQUEST maybe...but why, that would be redundant? so I suspect I suspect wrong.... Quote Link to comment https://forums.phpfreaks.com/topic/231880-explainfieldname-_requestfieldname/ Share on other sites More sharing options...
trq Posted March 27, 2011 Share Posted March 27, 2011 $_REQUEST is an alternative to $_GET, $_POST and $_COOKIE, it doesn't contain $_GET, $_POST and $_COOKIE as keys, but rather the data contained within $_GET, $_POST and $_COOKIE merged into a new array called $_REQUEST. Quote Link to comment https://forums.phpfreaks.com/topic/231880-explainfieldname-_requestfieldname/#findComment-1193038 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.