Given the following page:
<form>
<input type="radio" name="BT.123" value="active" />
<input type="radio" name="BT.123" value="inactive" />
<input type="submit" value="Submit" />
</form>
<?php
echo "GET: ", $_GET['BT.123'];
echo "POST: ", $_POST['BT.123'];
echo "REQUEST: ", $_REQUEST['BT.123'];
?>
Assume the “inactive” button is checked and the form is submitted. What is the output?
Show Answer ▼
Answer: Because the “.” is converted to “_”, only the string literals (and some warnings, if using E_STRICT) are output.
GET:
POST:
REQUEST:
In other words, use $_REQUEST[‘BT_123’] instead.