Within a php page (call it page1) I use PHP to fill in values for a javascript function. That function completes by opening a new page (window.open) and displaying the user's selection using the following:

<Script
(lines...)
document.write("<INPUT Type='text' NAME='ItemID' size='4' VALUE=" + opener.items[i].ItemID + ">");
(...lines)
</SCRIPT>

Further down in the php3 section I have a form to get the selection into the cart:

<?PHP
(lines...)
echo "<INPUT TYPE="hidden" NAME="UID" VALUE="$UID">";
(...lines)
mysql("$DBName","INSERT INTO TableName VALUES
('$UID','$ItemID',etc....);
%>

Somewhere before the form I need a way to say $ItemID is equal to the value in opener.items[i].ItemID. I'm pretty new to this and manage to make progress by trial and error but am stumped. I don't understand the syntax needed and can't figure out if I have to do it within the <Script></Script> tags. Guidance is greatly appreciated.

P.S. In case you are wondering why I don't just use the original values that were input into the array from the database, long story but there is a reason.



------------------
Thanks for the help.
ebryan@lumenet.com