Passing array variable with embedded URL link?

Need to build a pagelink that contains an array variable that has to be passed. how do i do this?

this code doesn't work:
[code]
$data[0]["name"] = "January";
$data[1]["name"] = "February";
$data[0]["value"] = "31";
$data[1]["value"] = "28";
echo "CLICK HERE";
[/code]

when this link gets clicked, the $mydata variable is shown in the URL box as [code]mydata=Array[/code] but i can't get to the values "inside"

This has got me really stumped, any help or ideas would be most welcome
and appreciated






Comments

  • : Need to build a pagelink that contains an array variable that has to be passed. how do i do this?
    :
    : this code doesn't work:
    : [code]
    : $data[0]["name"] = "January";
    : $data[1]["name"] = "February";
    : $data[0]["value"] = "31";
    : $data[1]["value"] = "28";
    : echo "CLICK HERE";
    : [/code]
    :
    : when this link gets clicked, the $mydata variable is shown in the URL box as [code]mydata=Array[/code] but i can't get to the values "inside"
    :
    : This has got me really stumped, any help or ideas would be most welcome
    : and appreciated
    :
    Hi,
    Your Months would be the element key, so you don't need the [0],[1], etc.
    Then, you will need to identify which element to include.
    [code]
    $data["January"] = "31";
    $data["February"] = "28";

    echo "CLICK HERE";
    [/code]

    Hope this helps.

    Jeff
  • : Your Months would be the element key, so you don't need the [0],[1],
    trust me, i do - not in this example perhaps but in my real world app

    : Then, you will need to identify which element to include.
    : [code]
    : echo "CLICK HERE";
    : [/code]
    sorry, not good enough; this is just passing 1 parameter...
    i want to pass the _entire_ array in one fell swoop and both the
    size & contents of this array are variable




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories