开发者

PHP: question about passing parameters in URL's

开发者 https://www.devze.com 2022-12-27 00:57 出处:网络
i have this two lines: var_dump($parametros_post_signin); $this->redirect(\'prueba/aux?email=\'.$parametros_post_signin[\'signin\']);

i have this two lines:

  var_dump($parametros_post_signin);

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

the first one prints this:

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

the second one takes to another 开发者_如何学编程action where i have this code:

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

that prints this:

string 'password' (length=8)

I expected it to print something like this:

string '' (length=0)

What should i do to the get value of the 'email_address' field ?

Regards

Javi


Try replacing

$parametros_post_signin['signin']

with

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

in the 2nd line.

$parametros_post_signin is a 2D array, to get to the email address you'll have to specify two dimensions.

0

精彩评论

暂无评论...
验证码 换一张
取 消