dongpu42006096 2013-07-22 04:06
浏览 16

通过重定向PHP发送数组

I'm trying to send an array to another page, such that when I get the array on the next page, only the array shows up and not the values. I then want to extract the values individually. I'm using the following code below. While this code works, on the redirect page, it returns 0=555928038&1=1694191&2=359564591&3=33280807&4=918458113 in the url. I don't want to see these values in the url. I want to see just the array and then I want to extract the values. What can I do to change this header redirect?

header('Location: twittercurlusershow.php?' . http_build_query($arrayoffollowers));
  • 写回答

2条回答 默认 最新

  • duanfeng3879 2013-07-22 04:10
    关注

    Store the array somewhere else (database, filesystem, session) along with a unique identifier. Attach the identifier to the URL. On the target page, restore the array from the identifier.

    Alternatively, serialize and base64-encode the array, add it to the url as a request variable and on the target page, base64-decode and unserialize it. This is only feasible for small arrays because the maximum length of URLs a Browser can handle might be as low as 2083 bytes.

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)