Welcome Guest, Not a member yet? Register   Sign In
getPost() not working as expected
#7

(10-29-2020, 04:09 PM)ojmichael Wrote: You should check for a POST request, and use the default values only for a GET request.

PHP Code:
if ($this->request->getMethod() === 'post') {
    $data['first_name'] $this->request->getPost('first_name', FILTER_SANITIZE_STRING);
} else {
    $data['first_name'] = $data['employee_data']['first_name'];


Many thanks,
I really appreciate your time and help.

So, I think we can conclude getPost() does not recognise empty form fields!
Reply


Messages In This Thread
getPost() not working as expected - by 68thorby68 - 10-29-2020, 03:01 AM
RE: getPost() not working as expected - by 68thorby68 - 10-30-2020, 02:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB