PHP: question about passing parameters in urls

i have two lines:

  var_dump($parametros_post_signin);

  $this->redirect('prueba/aux?email='.$parametros_post_signin['signin']);

first prints this:

array
  'signin' => 
    array
      'email_address' => string '' (length=0)
      'password' => string '' (length=0)

the second takes a different action, where I have this code:

var_dump($request->getParameter('email'));

which prints this:

string 'password' (length = 8)

I expected it to print something like this:

string '' (length = 0)

What do I need to do to get the value of the email_address field?

Hi

Xavi

+3
source share
1 answer

Try replacing

$parametros_post_signin['signin']

with

$parametros_post_signin['signin']['email_address']

in line 2nd.

$parametros_post_signin- this is an array 2Dto go to email address, you will need to specify two dimensions.

+3
source

Source: https://habr.com/ru/post/1741588/


All Articles