I have a form in a Code Igniter view in my jQuery Mobile application.
<form action="<?= BASE_PAGE_URL ?>settings" method="post" id="settingsForm">
<div data-role="fieldcontain">
<label for="firstName">First Name</label>
<input type="text" name="firstName" id="firstName" value="" placeholder="First Name" />
</div>
<div data-role="fieldcontain">
<label for="lastName">Last Name</label>
<input type="text" name="lastName" id="lastName" value="" placeholder="Last Name" />
</div>
<input type="hidden" name="purpose" value="register" />
<input type="submit" name="submit" value="Register" />
</form>
However, when I write this code into the controller method that the URL specified by action leads to:
echo ($_SERVER['REQUEST_METHOD'] == 'POST') ? "yay" : "nay";
"nay" is written to the page when I hit the submit button. How come Code Igniter cannot tell that I am submitting a post request?