Solved

Passing Array as QueryString

Posted on 2011-02-26
4
571 Views
Last Modified: 2012-05-11
How is this done, and how is it "opened" on the ensuing page?

Thanks~
0
Comment
Question by:Bob Schneider
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 34988400
It has to be converted to name/value pairs and put in the querystring: http://www.4guysfromrolla.com/webtech/101999-1.shtml shows how to construct and decode it.
0
 
LVL 2

Assisted Solution

by:rhawk
rhawk earned 250 total points
ID: 34992939
Off hand...
Here is a simple array.

<script type="text/javascript">
var a = new Array();
a.push(1);
a.push('apple')
a.push('4r');

document.getElementById('array').value=escape(a.toString());
</script>

Put that value into a hidden field (I called it array) and then post the form. On the other end, grab the value from request("array") and use split to convert it back to an array. The new array will be in the same order as the original.
0
 

Author Comment

by:Bob Schneider
ID: 34994048
Actually, I wrote it to a string and then broke it up into an array on the next page.
0
 

Author Closing Comment

by:Bob Schneider
ID: 34994051
Thanks a bunch!!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now