我如何从下拉列表中获取post值,以检查是否已选择给定值,并在if条件中使用它来检查是否只选择了像India这样的元素,那么只有他应该提交。我没有得到使用if和else条件的post值?
例如,为了获取国家,我正在使用
$country = $post['country'];--- how to do this in zend
我想做一些类似的验证
if($country == 'india) --- how to do this in zend framework
{welcome}
else
{'go to India'}
// In your controller
$country = $this->_request->getPost('country'); // Zend-Way to get POST-Data
if($country == 'india')
{
// It's India
}
else
{
// Not India
}