2

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));
9
  • 1
    since you are sending values through the URL, the values will be sent as GET which means they WILL show up in the URL. If you want to send values but not show them in the url, you can try setting values in the $_SESSION array. Commented Jul 22, 2013 at 4:11
  • 1
    This question needs a lot more research from OP to get a more specific question. It would seem there is a lack of understanding on how PHP works here. Commented Jul 22, 2013 at 4:11
  • @rgin I agree, a bit more clarity would be helpful here. Commented Jul 22, 2013 at 4:12
  • If you can extract the values in the next page, do your mind if the url is with 0=555928038&1=1694191&2=359564591&3=33280807&4=918458113? Commented Jul 22, 2013 at 4:17
  • The OP needs to understand the difference between GET and Post methods. Commented Jul 22, 2013 at 4:17

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

Comments

1

You could use the $_SESSION variable to store the array on your original page and then call it up from twittercurlusershow.php.

Here is a tutorial on using $_SESSION.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.