Solved

Store random Form results within PHP variables

Posted on 2008-10-15
2
260 Views
Last Modified: 2013-12-13
Hello Experts,
I have some Javascript code which will strip "var user_id" into individual values (these values are randomly generated prior to being stored within this variable ), and the values are then written as hidden input fields like below.

My question is how can i then get php to store this data into separate variables, for each posted input field when i dont know what the values are going to be, nor how many separate instances of the input fields will be generated.
var user_id= "1##2##3##4##5##6##7##8##9##10";
 
<form action="test.php" method="get" accept-charset="utf-8">
 
<input type="hidden" name="1" value="1">
 
<input type="hidden" name="2" value="2">
 
<input type="hidden" name="3" value="3">
 
<input type="hidden" name="4" value="4">
 
<input type="hidden" name="5" value="5">
 
<input type="hidden" name="6" value="6">
 
<input type="hidden" name="7" value="7">
 
<input type="hidden" name="8" value="8">
 
<input type="hidden" name="9" value="9">
 
<input type="hidden" name="10" value="10">
</form>

Open in new window

0
Comment
Question by:agulaid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 22728171
foreach($_GET as $key => $val)
{
 echo 'Variable: ' . $key . ' = ' . $val;
}

also, take a look at the fact that they are already in the get array:

print_r($_GET);
0
 

Author Closing Comment

by:agulaid
ID: 31506614
That works perfectly, thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

737 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