我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在zf2中将会话变量传递给外部URL

Here's my code:

        $sm = $this->getServiceLocator();

        $session = $sm->get('SessionContainer');
        $client = $session->offsetGet('client');

    $url = "http://local.clients.com/"

    $this->redirect()->toUrl($url);

I want to be able to pass $client to the $url e.g.

$this->redirect()->toUrl($url,$client);

Thanks.

Just add the data to the query string:

$url = "http://local.clients.com/";
$url .= '?'.http_build_query(array('client' => $client));

return $this->redirect()->toUrl($url);

近期文章

  • Microsoft Windows的命令行在哪里?
  • 有?postid = $ value来查看某个MySQL Row
  • 上传和附加文件以形成wordpress
  • PHP - 无法获得正确的关联数组结构
  • PHP自动将图像转换为数据URI
  • 删除具有特定条件的所有数组值
  • 使用php从XML文件中读取属性值
  • 在php中单独读取字符串的元素
  • CActioveform enableClientValidation不起作用
  • 在同一页面中显示HTML选择值
  • 如何使用php显示对弹出窗口的数组响应
  • Google App Engine,链接转到索引页面
  • 执行PHP CGI脚本作为后台进程?
  • 我应该在使用AJAX发送时散列密码吗?
  • Image Carousel data-slide-to =“?”使用WordPress PHP
  • 在cake php中的“webroot / img”文件夹中上传图片
  • 服务器响应使用php read_file MP3减速
  • 将附件文件上传到另一台服务器[Mybb]
  • 显示当前的不同URL的内容
  • 使用PHP从sql查询中获取特定的JSON数据

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华