Hi,
I saw a previous post about sending arrays but did not quite
understand the answers.
The problem is that I would like to pass an entire array as a hidden
input field from one php script to another. I've simplified the code
where form1.php calls form2.php when "Go" is hit:
form1.php
=========
<html>
<head>
<title>Form 1</title>
</head>
<body>
<h1>Form 1</h1>
<form action="form2.php" method=post>
<?
$record[0]="One";
$record[1]="Two";
printf("<input type=hidden name=\"record[]\" value=\"%s\">",$record);
?>
<input type=submit value="Go">
</form>
</body>
</html>
form2.php
=========
<html>
<head>
<title>Form 2</title>
</head>
<body>
<h1>Form 2</h1>
<?
$record=$_POST['record'];
printf("$record[0]=%s",$record[0]);
printf("$record[1]=%s",$record[1]);
?>
</body>
</html>
The result is:
Form 2
Array=Array=
How do I fix this?
Thanks in advance for any help.