P
P
Petr Volkhanov2015-04-22 20:02:42
Zend Framework
Petr Volkhanov, 2015-04-22 20:02:42

Why does the $_POST global array come empty?

There was a task of such a plan - it was necessary to add several fields to the form (1 - to enter the date of birth, 2 - for the address, 3 - to select the country and 4th to enter the index) in one of the CMS SocialEngine modules (objects are very similar to the Zend Framework ):
But when sending, of course, these new fields do not come to the mail. What is most interesting, when trying to get them in the controller, it does not work like this:

$birthDate = $_POST['birthdate'];
$address = $_POST['address'];
$country = $_POST['country'];
$postal = $_POST['postal'];

I get empty values! What is the best way to get such values ​​from the form?
Code from this link

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2015-04-22
@eprivalov

And so, as you wrote in the code by reference, doesn’t it work?

$birthDate = $this->_getParam('birthdate');
$address = $this->_getParam('address');
$country = $this->_getParam('country');
$postal = $this->_getParam('postal');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question